Am 05.02.2016 um 06:27 schrieb David Lattimore:
I'm attempting to upgrade an application from PDFBox 1.8.7 to
2.0.0-RC3. The following code works with the former but crashes with
the latter:
PDDocument document = PDDocument.load(new
File("/path/to/existing_js.pdf"));
document.getDocumentCatalog().getNames().getJavaScript().getNames();
The crash is as follows:
java.io.IOException: Error creating Javascript object, expected a
COSDictionary and not COSString{console.println("Hello console!");}
at
org.apache.pdfbox.pdmodel.PDJavascriptNameTreeNode.convertCOSToPD(PDJavascriptNameTreeNode.java:56)
at
org.apache.pdfbox.pdmodel.PDJavascriptNameTreeNode.convertCOSToPD(PDJavascriptNameTreeNode.java:1)
at
org.apache.pdfbox.pdmodel.common.PDNameTreeNode.getNames(PDNameTreeNode.java:261)
PDF is attached. Any suggestions?
Please upload the PDF on a public site. We'll check if this is our bug
or a bad PDF.
Tilman
Thanks,
David
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]