[ 
https://issues.apache.org/jira/browse/PDFBOX-5841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17855787#comment-17855787
 ] 

Tilman Hausherr commented on PDFBOX-5841:
-----------------------------------------

I'm worried because this is unexpected for an average user wanting to do 
similar manipulations. So the point of this change is that we assign the 
indirect object? I'm wondering if the problem would happen with the other 
assignments, e.g. ViewerPreferences if they exist.

> First split result document misses metadata after split
> -------------------------------------------------------
>
>                 Key: PDFBOX-5841
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5841
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Writing
>    Affects Versions: 3.0.3 PDFBox, 4.0.0
>            Reporter: Tilman Hausherr
>            Assignee: Andreas Lehmkühler
>            Priority: Major
>             Fix For: 3.0.3 PDFBox, 4.0.0
>
>         Attachments: splitresult1.pdf, splitresult2.pdf
>
>
> This happens with the test file of PDFBOX-5840 and can also be reproduced 
> with the command line utility: the first split result file doesn't have the 
> metadata.
> Alternatively it can be reproduced programmatically by adding this code below 
> {{assertEquals(5, pageTree.indexOf(pd5.getPage()));}} in 
> {code:java}
> assertNotNull(dstDoc.getDocumentCatalog().getMetadata());
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> dstDoc.save(baos);
> PDDocument reloadedDoc = Loader.loadPDF(baos.toByteArray());
> assertNotNull(reloadedDoc.getDocumentCatalog().getMetadata());
> reloadedDoc.close();
> {code}
> I believe this is another writing problem, because the metadata exists, but 
> gets lost during the first save, not during a second one (not part of the 
> test code). It is expected to be object 116. It doesn't happen with 2.0. 
> Attached: two saved files by splitting so that the entire file is the result.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to