newbie question - bitmap output quality

768 views
Skip to first unread message

younan fakhouri

unread,
Jun 19, 2014, 7:28:57 AM6/19/14
to pdf...@googlegroups.com
I built the test program on ubuntu linux and was able to use it to render a pdf, but the output resolution is lower than the original and small text on the output became blurred and illegible. Any tips how to use the fpdfview to control quality of the rendered output? Or point me to some relevant documentation?
original.png
rendered.png

Adam Schepis

unread,
Jun 24, 2014, 3:08:25 PM6/24/14
to pdf...@googlegroups.com
I'm not an expert on PDF or typography so i could be wrong here, but I think that this is because FPDF_GetPageWidth() and FPDF_GetPageHeight() give the height and width of the document in points, not pixels. A point is equivalent to 1/72 of an inch.

pdfium_test creates a bitmap that is FPDF_GetPageWidth()xFPDF_GetPageHeight() pixels. So the page is being rendered at fairly low quality. I'm just digging into pdfium myself but it looks like there are some lower level APIs used by the FPDF_ APIs that may give you some more flexibility.

Adam Schepis

unread,
Jun 24, 2014, 3:51:48 PM6/24/14
to pdf...@googlegroups.com
Update: i havent dug into the code to see why this works yet, but in pdfium_test.cc if you convert width and height to the desired dpi (or just scale them up) it willl render into the bitmap at the appropriate quality.  so if you multiply width and height by 4 you will get a much larger, clearer image.

younan fakhouri

unread,
Jun 25, 2014, 12:18:02 PM6/25/14
to pdf...@googlegroups.com
I can confirm I was able to generate much higher quality bitmaps after scaling the height and width up like you suggested. Thanks
Reply all
Reply to author
Forward
0 new messages