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

NullPointerException in PDTrueTypeFont.java if glyf table is missing

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.2
    • 2.0.3
    • FontBox, Rendering
    • None

    Description

      Caused by: java.lang.NullPointerException: null
          org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getPath(PDTrueTypeFont.java:444)
          org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getNormalizedPath(PDTrueTypeFont.java:502)
          org.apache.pdfbox.rendering.GlyphCache.getPathForCharacterCode(GlyphCache.java:71)
          org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:350)
          org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:756)
          org.apache.pdfbox.debugger.pagepane.DebugPageDrawer.showGlyph(DebugPageDrawer.java:59)
          org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:713)
          org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:572)
          org.apache.pdfbox.contentstream.operator.text.ShowText.process(ShowText.java:55)
      

      The cause is the change in PDFBOX-3395; previously PDFBox would consider the font to be bad and replace it. Now we don't do that because the glyf table is not always needed.

      I'm throwing a checked exception for now but a better solution should be found. Adobe Reader displays glyphs.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jahewson John Hewson
            tilman Tilman Hausherr
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment