You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2013/12/08 14:53:36 UTC

[jira] [Resolved] (PDFBOX-1769) Fix crash on invalid xref

     [ https://issues.apache.org/jira/browse/PDFBOX-1769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler resolved PDFBOX-1769.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0

The remaining issues can't be solved as the given pdf is corrupt. Even the acrobat reader complains about it.

Set to resolved as the main topic, the invalid xref table, is solved.

Thanks for the report!

> 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
>             Fix For: 2.0.0
>
>
> 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)