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

Tilman Hausherr commented on PDFBOX-3761:
-----------------------------------------

This is now fixed in the snapshot at 
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/2.0.6-SNAPSHOT/

If you need a workaround until 2.0.6 is released (a few months) then remove 
/Outlines when empty:
{code}
PDDocumentOutline outline = doc.getDocumentCatalog().getDocumentOutline();
if (outline != null && outline.getFirstChild() == null)
{
    doc.getDocumentCatalog().setDocumentOutline(null);
}
{code}

> Exception in thread "main" java.lang.NullPointerException
> ---------------------------------------------------------
>
>                 Key: PDFBOX-3761
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3761
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.5
>         Environment: Java 1.8, Windows.
>            Reporter: Durgesh Agrawal
>         Attachments: 0000000013340857.pdf, 0000001744905808.pdf, 
> PDFMergerExample.java, TestMergePdf.java
>
>
> Getting Nullpointer exception when running PDFMergerExample
> Exception in thread "main" java.lang.NullPointerException
>       at 
> org.apache.pdfbox.multipdf.PDFMergerUtility.appendDocument(PDFMergerUtility.java:432)
>       at 
> org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:261)
>       at 
> scrach_pad.batch_email.PDFMergerExample.merge(PDFMergerExample.java:87)
>       at scrach_pad.batch_email.TestMergePdf.main(TestMergePdf.java:50)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to