We convert PDFs to PNG using Aspose PDF.NET and are generally happy with the results.
We have been provided with a PDF document that has a low-quality font (it looks pixelated and not vector-smooth, but it is a font and not an image). The PDF document is readable. When we convert it to a PNG the output image is unreadable with characters completely missing upstrokes and horizontal strokes.
If we push the output PNG to a resolution that is massive and then take the output massive image and use
System.Drawing.Bitmap to resize the image to something back to what we wanted, we can get readable results, but this is an impractical workaround to avoid Aspose.PDF not being able to create a readable image in our desired size / resolution.
We use more options than the code below (and have tried all the
RenderingOptions) but we can recreate the issue with this document with the following code:
Dim document As Aspose.Pdf.Document = New Aspose.Pdf.Document("c:\temp\test.pdf") Dim page As Aspose.Pdf.Page = document.Pages(1) Dim pngDevice As New Aspose.Pdf.Devices.PngDevice(New Aspose.Pdf.PageSize(page.Rect.Width, page.Rect.Height)) pngDevice.Process(page, "c:\temp\test.png")
We are using the latest version of Aspose.PDF v19.6.0
Attachments included below -
test.pdf is the source document and
test.png is the output image.
Problem can be seen in first word on the document - HIRING is missing the upstroke in the R - but most characters are pretty poor.
Any support would be much appreciated