Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
3.0.2 PDFBox
-
None
-
Happens both on our server environment (Linux) and when testing locally (Windows)
Description
After upgrading from PDFBox 3.0.1 to version 3.0.2 I experienced a NullPointerException when using the split() method:
java.lang.NullPointerException: Cannot invoke "org.apache.pdfbox.pdmodel.common.PDNumberTreeNode.getNumbers()" because "tree" is null at org.apache.pdfbox.multipdf.PDFMergerUtility.getNumberTreeAsMap(PDFMergerUtility.java:1156) at org.apache.pdfbox.multipdf.Splitter.cloneStructureTree(Splitter.java:192) at org.apache.pdfbox.multipdf.Splitter.split(Splitter.java:135)
When testing with different inputs, I noticed that the issue only occurred when using a PDF generated from Keynote. I attached an example below to reproduce the issue.
Downgrading to 3.0.1 again solves the issue.
This is proably caused by PDFBOX-2725 and this commit. The issue happens in this segment of Splitter.java:
PDNumberTreeNode srcParentTree = srcStructureTreeRoot.getParentTree(); // srcParentTree is null here Map<Integer, COSObjectable> srcNumberTreeAsMap = PDFMergerUtility.getNumberTreeAsMap(srcParentTree);
Attachments
Attachments
Issue Links
- duplicates
-
PDFBOX-5809 PDDocument#importPage slowed down by factor 1300
- Closed