We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PdfConvertor Image quality

Hi,

One of the things we want to use your library for is to create previews of various file formats. I have created 300px (width or height) previews using Words, Cells and Slides with good results. Using PdfConverter to create images works but is far poorer quality at the same resolution. Why is this and is there a better alternative for a pdf preview?

Sample code:
PdfConverter pdfConvertor = new PdfConverter();
pdfConvertor.BindPdf(filePath);
pdfConvertor.DoConvert();

pdfConvertor.GetNextImage(outPath, ImageFormat.Jpeg, (float)previewSize.Width, (float)previewSize.Height, imageFormat.JPEGQuality);

Hi Jai,

Please set the Resolution property of the PdfConverter class. The default value is 150, however you may set higher values to see if it produces the output of required quality. However, please note that higher the resolution lower the conversion speed. If it still doesn’t resolve your issue then please share the input PDF file with us, so we could investigate the issue at our end.

We’re sorry for the inconvenience.
Regards,

Hi Shahzad,

Thanks for your response but I refer to the comparable quality at the same resolution. For example creating a 212*300 jpg A4 preview of the same document saved in both Word and PDF format, the Aspose.Words.Document.Save() does a far better job than PdfConvertor.GetNextImage().

What I have found is that an image created with width or height below about 600px is poor. Above this it’s acceptable. As a workaround I create an image using GetNextImage() with width or height about 1000px and then open the image using System.Drawing.Image and reduce it’s size. Ideally having to reopen the image to rescale wouldn’t be necessary.

Attached are the Word and PDF originals and images created from both.

Hi Jai,

I have reproduced the problem at my end and logged it as PDFNEWNET-29470 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once it is resolved.

We’re sorry for the inconvenience.
Regards,

The issues you have found earlier (filed as PDFNEWNET-29470) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.