You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2014/07/17 23:54:18 UTC

[jira] [Commented] (PDFBOX-2218) PDFCheckbox NPE

    [ https://issues.apache.org/jira/browse/PDFBOX-2218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14065629#comment-14065629 ] 

Tilman Hausherr commented on PDFBOX-2218:
-----------------------------------------

It would be helpful to have a standalone failure code, i.e. without TIKA.

> PDFCheckbox NPE
> ---------------
>
>                 Key: PDFBOX-2218
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2218
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 1.8.4
>         Environment: Ubuntu
>            Reporter: Mohmed
>             Fix For: 1.8.7
>
>         Attachments: SCJP Sun Certified Programmer for Java 6-0071591060.pdf, pdf_parsing_stack_trace
>
>
> PDF parsing fails for attached PDF.
> Stack trace of failure attached to issue
> Sample code use to parse
> TikaInputStream tikaStream = TikaInputStream.get(stream);
>     TikaResultWrapper result;
>     try {
>       long streamSize = tikaStream.getLength();
>       Metadata metadata =
>         constructMetadata(fileName, mimeType, streamSize);
>       if (streamSize < maxFileSize) {
>         SamplingSaxHandler handler =
>           new SamplingSaxHandler(samplingSize, metadata);
>         handler.setBufferLimit(bufferSize);
>         parser.parse(tikaStream, handler, metadata, new ParseContext());
>         result = handler.getResult();
>       } else {
>         result = new TikaResultWrapper(null, metadata);
>       }
>     } finally {
>       tikaStream.close();
>     }
>     return result;



--
This message was sent by Atlassian JIRA
(v6.2#6252)