You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by "Allison, Timothy B." <ta...@mitre.org> on 2016/09/16 12:11:50 UTC
RE: [Tika] I have a question. --> "Exception :
org.apache.pdfbox.cos.COSArray cannot be cast to
org.apache.pdfbox.cos.COSDictionary"
-----Original Message-----
From: question.answer.id@gmail.com [mailto:question.answer.id@gmail.com]
Sent: Friday, September 16, 2016 8:11 AM
To: user@tika.apache.org
Subject: Re: [Tika] I have a question. --> "Exception : org.apache.pdfbox.cos.COSArray cannot be cast to org.apache.pdfbox.cos.COSDictionary"
Thank you for your answer :)
By the way do you I can if you wait an answer from you?
I do not know what should I where to questions about pdfbox.
--
syosinnsya
> Could be a bug in PDFBox. Might want to ask on the pdfbox users' list.
>
> -----Original Message-----
> From: question.answer.id@gmail.com [mailto:question.answer.id@gmail.com]
> Sent: Friday, September 16, 2016 7:30 AM
> To: user@tika.apache.org
> Subject: [Tika] I have a question. --> "Exception : org.apache.pdfbox.cos.COSArray cannot be cast to org.apache.pdfbox.cos.COSDictionary"
>
> An exception is raised in line:"parser.parse(new Fil ....".
>
> "Exception : org.apache.pdfbox.cos.COSArray cannot be cast to org.apache.pdfbox.cos.COSDictionary"
>
> Why exception occurs?
> In other dozens of PDF, the exception does not occur.
>
>
>
> below, my program.
> -----------------------------------------------------
> try {
> File document = new File("/usr/local/sample.pdf");
>
> PDFParser parser = new PDFParser();
> ContentHandler handler = new BodyContentHandler(Integer.MAX_VALUE);
> Metadata metadata = new Metadata();
> parser.parse(new FileInputStream(document), handler, metadata
> , new ParseContext());
>
> String plainText = handler.toString();
> System.out.println(plainText);
> }
> catch (FileNotFoundException e) {
> e.printStackTrace();
> throw new RuntimeException(e.getMessage()); } catch (IOException e) {
> e.printStackTrace();
> throw new RuntimeException(e.getMessage()); } catch (SAXException e) {
> e.printStackTrace();
> throw new RuntimeException(e.getMessage()); } catch (TikaException e) {
> e.printStackTrace();
> throw new RuntimeException(e.getMessage()); } catch (Exception e) {
> e.printStackTrace();
> throw new RuntimeException(e.getMessage()); }
> -----------------------------------------------------
>
> --
> syosinnsya
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: [Tika] I have a question. --> "Exception :
org.apache.pdfbox.cos.COSArray cannot be cast to
org.apache.pdfbox.cos.COSDictionary"
Posted by Tilman Hausherr <TH...@t-online.de>.
Please upload your PDF file somewhere and tell what PDFBox version you
are using.
(In the PDFBox user mailing list)
Tilman
>
> -----Original Message-----
> From: question.answer.id@gmail.com [mailto:question.answer.id@gmail.com]
> Sent: Friday, September 16, 2016 8:11 AM
> To: user@tika.apache.org
> Subject: Re: [Tika] I have a question. --> "Exception : org.apache.pdfbox.cos.COSArray cannot be cast to org.apache.pdfbox.cos.COSDictionary"
>
> Thank you for your answer :)
>
> By the way do you I can if you wait an answer from you?
> I do not know what should I where to questions about pdfbox.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org