Hi,
I am using pdf box for parsing pdf documents and lately I used the newest
version of your jar file 1.5.0.
Here is my code snippet:
public static byte[] parsePDF (byte[] document) throws IOException
PDDocument doc = null;
try {
doc = PDDocument.load(new ByteArrayInputStream(document));
if (doc == null) {
throw new IllegalStateException("Cannot load the pdf
document!");
}
PDDocumentCatalog catalog = doc.getDocumentCatalog();
if (catalog == null) {
return document;
}
...
} finally {
if (doc != null) {
doc.close();
}
}
.....
}
and I got this exception on the call doc.getDocumentCatalog() :
java.lang.NullPointerException
at
org.apache.pdfbox.pdmodel.PDDocument.getDocumentCatalog(PDDocument.java:419)
I have attached also the pdf that is creating problems!
Do you have any idea which is the problem?
Thank you,
Mariana Didu