[
https://issues.apache.org/jira/browse/PDFBOX-4177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tilman Hausherr closed PDFBOX-4177.
-----------------------------------
Resolution: Not A Bug
Closing as this isn't a bug. This is the content stream:
{code:java}
q
400 0 0 283 0 0 cm
/Im1 Do
Q
{code}
The series of numbers is an affine transformation. The two non zero numbers are
the width and the height. So all is as it should be.
I also found out how to tame Adobe Reader: go to preferences, page display
preferences, and instead of choosing "use system setting", choose "custom
resolution" of 72dpi. Then when choosing 100% the file is displayed as expected.
> PDFBox seems to scale up image while it should not
> --------------------------------------------------
>
> Key: PDFBOX-4177
> URL: https://issues.apache.org/jira/browse/PDFBOX-4177
> Project: PDFBox
> Issue Type: Bug
> Reporter: Kamil
> Priority: Major
> Attachments: comparison-tilman.png, comparison.png, test.jpg, test.pdf
>
>
> I have a test image (in attachment) and the following code:
> {code:java}
> public static void main(String[] args) {
> final String filename = "test.jpg";
> try (
> final PDDocument doc = new PDDocument();
> final FileInputStream input = new FileInputStream(new File(filename));
> final ByteArrayOutputStream pdfOut = new ByteArrayOutputStream();
> final FileOutputStream output = new FileOutputStream("test.pdf")
> ) {
> final PDImageXObject jpeg = PDImageXObject.createFromByteArray(doc,
> IOUtils.toByteArray(input), filename);
> final PDPage page = new PDPage(new PDRectangle(jpeg.getWidth(),
> jpeg.getHeight()));
> doc.addPage(page);
> try (final PDPageContentStream contents = new PDPageContentStream(doc,
> page)) {
> contents.drawImage(jpeg, 0, 0);
> }
> doc.save(pdfOut);
> pdfOut.flush();
> IOUtils.write(pdfOut.toByteArray(), output);
> }catch (Exception e) {
> e.printStackTrace();
> }
> }
> {code}
> The image in test.pdf is double sized (and quality is worse) than in original
> image
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]