Lucas Welscher created PDFBOX-5833:
--------------------------------------
Summary: NullPointerException when calling Splitter.split() with
pdf files generated by Keynote
Key: PDFBOX-5833
URL: https://issues.apache.org/jira/browse/PDFBOX-5833
Project: PDFBox
Issue Type: Bug
Components: Utilities
Affects Versions: 3.0.2 PDFBox
Environment: Happens both on our server environment (Linux) and when
testing locally (Windows)
Reporter: Lucas Welscher
Attachments: Infun2324.L02.Control.Structures.pdf
After upgrading from PDFBox 3.0.1 to version 3.0.2 I experienced a
NullPointerException when using the split() method:
{code:java}
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)
{code}
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|https://svn.apache.org/viewvc?view=revision&revision=1915447] commit. The
issue happens in this segment of Splitter.java:
{code:java}
PDNumberTreeNode srcParentTree = srcStructureTreeRoot.getParentTree();
// srcParentTree is null here
Map<Integer, COSObjectable> srcNumberTreeAsMap =
PDFMergerUtility.getNumberTreeAsMap(srcParentTree);
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]