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

Free Support Forum - aspose.com

PDF to image conversion bad quality

Hi


I convert PDF to an image with the following code:

Using Aspose PDF 11.7.0.0 / June 16, 2016
using (var stream = new MemoryStream(bytes)){
var doc = new Document(stream);

using (FileStream imageStream = new
FileStream(“c:/temp/converted.png”, FileMode.Create)){
Resolution resolution = new Resolution(600);
var pngDevice = new PngDevice(resolution);
pngDevice.Process(doc.Pages[1], imageStream);
imageStream.Close();
}
}

Attached are input pdf and output png. The Barcode conversion is useless. It does not matter wether I convert to Jpeg / Tiff / png or increase the resolution, the barcode is always converted like this. Is there a fix for this?

Hi David,

Thanks for your inquiry. I have tested your scenario with shared document using Aspose.Pdf for .NET 11.7.0 and managed to observe the reported issue of bad quality. For further investigation, I have logged an issue in our issue tracking system as PDFNET-40970 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

We are sorry for the inconvenience caused.

<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;mso-fareast-font-family:
Calibri;color:#333333;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA”>Best Regards,

Hi…

I, too, am experiencing what I would describe as poor image quality when converting PDF to TIF.

While the final output does, in fact, have the DPI I specify (I’ve tried 200, 300 and 600), I believe the Root Cause of these poor quality images is the “TIFFDevice” upon which you’re rendering the PDF has a NATIVE DPI of 96 (for a screen), or 72 (for PDFs).

I believe the DPI needs to be set into the graphics device BEFORE rendering happens.

p.s. I’m using Aspose.PDF 17.7

@wardmd90745

Thank you for contacting support.

Would you please share source and generated files along with a narrowed down sample application reproducing this issue so that we may try to reproduce and investigate it. Before sharing requested data, please ensure using Aspose.PDF for .NET 18.8 in your environment.