[
https://issues.apache.org/jira/browse/PDFBOX-2828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14583884#comment-14583884
]
John Hewson commented on PDFBOX-2828:
-------------------------------------
Your DPI calculations are incorrect, 300 DPI is glossy magazine quality, not a
tiny thumbnail. The scale parameter of renderImage is just that, a scale, e.g
x1, x2, x4. You have to call renderImageWithDPI if you want to use DPI values.
Anyway, the images you've attached are not blurry. What exactly is the problem?
> Blurred Images using PDFBox 2.0
> -------------------------------
>
> Key: PDFBOX-2828
> URL: https://issues.apache.org/jira/browse/PDFBOX-2828
> Project: PDFBox
> Issue Type: Improvement
> Components: Rendering
> Affects Versions: 2.0.0
> Reporter: Lori
> Attachments: 1_4_resolution_1280.png, 3_4.pdf,
> 3_4_resolution_1280.png, 3_4_resolution_2000.png, 3_4_resolution_300.png
>
>
> PNG images generated from PDF are blurry. I've tried a variety of
> resolutions including default. (The code adjust scale so that the max of
> width or height equals the resolution). Any help appreciated - I am new to
> image processing so I apologize if I've missing something blatant.
> {code}
> PDPage page = doc.getPage(i);
> PDRectangle cropbBox = page.getCropBox();
> float widthPt = cropbBox.getWidth();
> float heightPt = cropbBox.getHeight();
> float max = Math.max(widthPt, heightPt);
> float scale = resolution/max;
> //int widthPx = Math.round(widthPt * scale);
> //nt heightPx = Math.round(heightPt * scale);
> BufferedImage image = renderer.renderImage(i,
> scale);//300 pixels/inches 1/72 inches/pt
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]