You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Chupacabras (JIRA)" <ji...@apache.org> on 2012/08/21 15:47:38 UTC

[jira] [Updated] (PDFBOX-1394) Image streams are lost when adding new images to page

     [ https://issues.apache.org/jira/browse/PDFBOX-1394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chupacabras updated PDFBOX-1394:
--------------------------------

    Attachment: input.pdf
    
> Image streams are lost when adding new images to page
> -----------------------------------------------------
>
>                 Key: PDFBOX-1394
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1394
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.7.1
>         Environment: Oracle JDK 1.6.0_26
>            Reporter: Chupacabras
>         Attachments: input.pdf, output.pdf
>
>
> I open existing PDF which contains images. Then I want to insert new images and save it as new PDF.
> The resulting PDF does not contain original images, just the new ones. Adobe Reader complains about missing object too.
> PDDocument pdDoc=PDDocument.load("input.pdf", false);
> PDXObjectImage ximage = new PDJpeg(pdDoc, bufferedImage);
> PDPage page=(PDPage) pdDoc.getDocumentCatalog().getAllPages().get(0);
> PDPageContentStream content = new PDPageContentStream(pdDoc, page, true, true);
> content.drawXObject(ximage, 100, 600, 200, 130);
> // or content.drawImage(ximage, 0, 0);
> content.close();
> pdDoc.save("output.pdf");
> pdDoc.close();
> When I look into PDF binary file I can see only 1 image stream (the one I added) and I can't see streams of original images, they simply are not there.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira