Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1241

Better handle of missing offset at the end of a file

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.8.3
    • Component/s: Parsing, Text extraction
    • Labels:
      None
    • Environment:
      All platforms affected

      Description

      We came across PDF files that do not have an offset at the end of the file.
      This leads to the following exeption:

      c:\tmp> java -jar pdfbox-app-1.6.0.jar ExtractText -endPage 1 "On the Insert tab.pdf"
      ExtractText failed with the following exception:
      java.io.IOException: Error: Expected an integer type, actual=''
      at org.apache.pdfbox.pdfparser.BaseParser.readInt(BaseParser.java:1384)
      at org.apache.pdfbox.pdfparser.PDFParser.parseStartXref(PDFParser.java:6
      63)
      at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:464)

      at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:184)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1088)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1053)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:978)
      at org.apache.pdfbox.ExtractText.startExtraction(ExtractText.java:196)
      at org.apache.pdfbox.ExtractText.main(ExtractText.java:76)
      at org.apache.pdfbox.PDFBox.main(PDFBox.java:42)

      While these PDFs are non-conforming, it'd be an improvement to allow them to be read and processed.

        Attachments

        1. On the Insert tab.pdf
          84 kB
          Ernst Eibensteiner

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ernst.eibensteiner Ernst Eibensteiner
            • Votes:
              7 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: