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?

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

Reply via email to