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

Tilman Hausherr edited comment on PDFBOX-5833 at 6/4/24 2:36 PM:
-----------------------------------------------------------------

Likely duplicate of PDFBOX-5809 (or rather, it was likely fixed in that ticket 
with https://svn.apache.org/r1917466 ). Please test with a snapshot:
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.3-SNAPSHOT/


was (Author: tilman):
Likely duplicate of PDFBOX-5809 (or rather, it was likely fixed in that 
ticket). Please test with a snapshot:
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.3-SNAPSHOT/

> 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
>            Priority: Major
>              Labels: bug, regresion
>         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: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to