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

NullPointerException: Cannot invoke "String.codePointAt(int)" because "uni" is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.31, 3.0.2 PDFBox
    • 2.0.32, 3.0.3 PDFBox, 4.0.0
    • None
    • None

    Description

      As reported to me by T.G.

      Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.codePointAt(int)" because "uni" is null
      
      	at org.apache.pdfbox.pdmodel.font.PDTrueTypeFontEmbedder.setWidths(PDTrueTypeFontEmbedder.java:102)
      

      This happens when an existing encoding is passed to PDTrueTypeFont.load() with the 3rd parameter being an existing encoding "with differences" from another font and this encoding has a ".notdef", because this isn't in the Adobe glyph list. The whole thing is done to replace a simple not embedded font with a hopefully equivalent embedded font.

      Solution: assume GID 0 for such cases.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: