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

java.io.IOException: Error: End-of-File, expected line during PDDocument.load

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.0.20, 2.0.21
    • Fix Version/s: None
    • Component/s: Parsing
    • Labels:
      None
    • Environment:
      Debian, MacOs, open JDK 12

      Description

      I got an I/O Exception when I try to open some PDF using the lib (calling PDDocument.load(pdfFile)). Here are some urls with affected PDF (I think it's the same problem for all of them) :

      I think the files are not well formatted and doesn't respect PDF specs but I can open them using other pdf viewer (like chrome pdf viewer for example)

       

      Here is the stack trace : 

      java.io.IOException: Error: End-of-File, expected linejava.io.IOException: Error: End-of-File, expected line at org.apache.pdfbox.pdfparser.BaseParser.readLine(BaseParser.java:1098) at org.apache.pdfbox.pdfparser.COSParser.parseHeader(COSParser.java:2581) at org.apache.pdfbox.pdfparser.COSParser.parsePDFHeader(COSParser.java:2560) at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:219) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1099) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1082) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1041) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:989)
      

        Attachments

        1. Rehbein_Schule_Hanau_9_2018.txt
          3 kB
          Maruan Sahyoun
        2. Rehbein_Schule_Hanau_9_2018.pdf
          2.37 MB
          Nicolas M

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nmarlk Nicolas M
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: