aspose.pdf.dll for .net , 版本号24.6.0.0,图片转pdf后,pdf里的图片变成黑白颜色。
示例代码:
void testImageToPdf()
{
ImageStamp ^ imageStamp = gcnew ImageStamp(gcnew String(“C:\Users\Administrator\Desktop\test99.jpg”));
imageStamp->Width = 4964;
imageStamp->Height = 3370;
Document^ pdfDocument = gcnew Document();
Page^ page = pdfDocument->Pages->Add();
page->SetPageSize(imageStamp->Width, imageStamp->Height);
page->AddStamp(imageStamp);
pdfDocument->Save(gcnew String(“C:\Users\Administrator\Desktop\test99.pdf”));
}
040651faad7510a27f5e3afab2a63d6.jpg (252.2 KB)