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

Can't load any text when font is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.7.0, 1.8.0
    • 1.7.1
    • PDModel
    • None
    • JDK 1.6 64bit

    Description

      Open 19472133.PDF PdfboxReader without "-nonSeq" parameter.
      Turn to page 3, many NullPointerExceptions are displayed, and pdfviewer can't show any text.

      java.lang.NullPointerException
      at org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngine.java:366)
      at org.apache.pdfbox.util.operator.ShowTextGlyph.process(ShowTextGlyph.java:62)
      at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:556)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:270)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:246)
      at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:217)
      at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:119)
      at org.apache.pdfbox.pdfviewer.PDFPagePanel.paint(PDFPagePanel.java:98)
      java.util.EmptyStackException
      at java.util.Stack.peek(Stack.java:85)
      at org.apache.pdfbox.util.PDFStreamEngine.getFonts(PDFStreamEngine.java:601)
      at org.apache.pdfbox.util.operator.SetTextFont.process(SetTextFont.java:54)
      at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:556)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:270)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:246)
      at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:217)
      at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:119)
      at org.apache.pdfbox.pdfviewer.PDFPagePanel.paint(PDFPagePanel.java:98)
      at javax.swing.JComponent.paintChildren(JComponent.java:862)

      Open document with "-nonSeq" parameter

      Exception in thread "main" java.io.IOException: Error reading stream using length value. Expected='endstream' actual=''
      at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.parseCOSStream(NonSequentialPDFParser.java:1327)
      at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.parseObjectDynamically(NonSequentialPDFParser.java:1032)
      at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.parseObjectDynamically(NonSequentialPDFParser.java:955)
      at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.parseDictObjects(NonSequentialPDFParser.java:929)
      at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.initialParse(NonSequentialPDFParser.java:337)
      at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.parse(NonSequentialPDFParser.java:574)
      at org.apache.pdfbox.pdmodel.PDDocument.loadNonSeq(PDDocument.java:1124)
      at org.apache.pdfbox.PDFReader.parseDocument(PDFReader.java:378)
      at org.apache.pdfbox.PDFReader.openPDFFile(PDFReader.java:319)
      at org.apache.pdfbox.PDFReader.main(PDFReader.java:305)

      Attachments

        1. 19472133.PDF
          262 kB
          philip huang

        Activity

          People

            tboehme Timo Boehme
            szqed philip huang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: