Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.3 PDFBox, 4.0.0
-
None
Description
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
assertNotNull(dstDoc.getDocumentCatalog().getMetadata());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
dstDoc.save(baos);
PDDocument reloadedDoc = Loader.loadPDF(baos.toByteArray());
assertNotNull(reloadedDoc.getDocumentCatalog().getMetadata());
reloadedDoc.close();
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.