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

Andreas Lehmkühler edited comment on PDFBOX-1769 at 12/8/13 12:05 PM:
----------------------------------------------------------------------

I added a "self healing" mechanism to the non-sequential parser to fix corrupt 
offsets within the xref table in revision 1549022.

The parser seeks 200 bytes backward/forward if the object can't be found at the 
given offset.

Now, there is an issue with the length of a stream. I'm looking into it too.


was (Author: lehmi):
I added a "self healing" mechanism to the non-sequential parser to fix corrupt 
offsets within the xref table in revision 1549022.
The parser seeks 200 bytes backward/forward if the object can't be found at the 
given offset.



> Fix crash on invalid xref
> -------------------------
>
>                 Key: PDFBOX-1769
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1769
>             Project: PDFBox
>          Issue Type: Wish
>          Components: Parsing
>    Affects Versions: 1.8.2
>            Reporter: William Palmer
>            Assignee: Andreas Lehmkühler
>
> Need to search for a correct xref start address
> Example file:
> http://digitalcorpora.org/corp/nps/files/govdocs1/020/020747.pdf
> Exception in thread "main" java.io.IOException: Error: Expected an integer 
> type, actual='ref'
> at org.apache.pdfbox.pdfparser.BaseParser.readInt(BaseParser.java:1622)
> Using the code:
> PDFTextStripper ts = new PDFTextStripper();
> PrintWriter out = new PrintWriter(new FileWriter(new File (pFile+".txt")));
> RandomAccess scratchFile = new 
> RandomAccessFile(File.createTempFile("pdfbox-", ".tmp"), "rw");
> PDDocument doc = PDDocument.loadNonSeq(new File(pFile), scratchFile)
> ts.setForceParsing(true);
> ts.writeText(doc, out); 
> Related: PDFBOX-1757



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to