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

Adam Nichols commented on PDFBOX-578:
-------------------------------------

Although the patch avoids the NPE, I think it hides the problem (which is that 
the PDF can't be parsed because it's non-conforming).  If we merge file xyz.pdf 
with SWMC_WarehouseAgreement-V1.pdf and no exception is thrown, we'd naturally 
expect that the files were merged correctly, however that's not the case here.  
I'd rather see an exception be thrown if there was a critical error like this.  
I was hoping that this task would lead to correcting the parser (or whatever it 
is that's wrong) so the document could be processed without error.

I came back to this issue and tried to decompress it using pdftk and I found 
that could not handle the errors in this PDF either.  If I could get       
SWMC_WarehouseAgreement-V1.pdf in an uncompressed state (and the problem still 
exists), I could manually trace through the PDF to find out where the issue 
lies.  But unless someone can figure out some way to decompress it, I think we 
should consider this one closed.  The other PDF is working, which indicates 
that the issue was resolved for some PDFs.

> NPE NullPointerException in PDPageNode.getCount
> -----------------------------------------------
>
>                 Key: PDFBOX-578
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-578
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 0.8.0-incubator
>            Reporter: James Wilson
>         Attachments: 0000462526-0000000000-04cv00399.pdf, 
> FormI-9-English.pdf, nullcount.patch, SWMC_WarehouseAgreement-V1.pdf
>
>
> java.lang.NullPointerException
>         at org.apache.pdfbox.pdmodel.PDPageNode.getCount(PDPageNode.java:102)
>         at 
> org.apache.pdfbox.pdmodel.PDDocument.getNumberOfPages(PDDocument.java:925)
>         at 
> us.fed.nmcourt.common.pdfbox.NmdLucenePDFDocument.addContent(NmdLucenePDFDocument.java:558)
>         at 
> us.fed.nmcourt.common.pdfbox.NmdLucenePDFDocument.convertDocument(NmdLucenePDFDocument.java:346)
>         at 
> us.fed.nmcourt.common.pdfbox.NmdLucenePDFDocument.getDocument(NmdLucenePDFDocument.java:444)
>         at 
> us.fed.nmcourt.common.pdfbox.NmdLucenePDFDocument.main(NmdLucenePDFDocument.java:758)
> Attached is an example of pdf that causes this exception.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to