Details
Description
I came across a non-conforming PDF which resulted in a NPE when I tried to append a page to the document. The error was because there were no kids listed, so when rootPages.getKids().add(page); was called in addPage(PDPage page) it went into the COSArray.add() but threw an exception on line 180: array.add(((COSObjectable)o).getCOSObject()); I fixed this by checking to see if array was null before attempting to call the add() method.
I can not attach the sample PDF because it contains confidential data.
Despite the major non-conforming aspects of this PDF, Adobe reader is able to open it. This is one reason why I want to make sure PDFBox can at least process the file without throwing an exception.