pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Error creating Javascript object, expected a COSDictionary and not COSString
Date Fri, 05 Feb 2016 07:39:52 GMT
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: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message