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

Throwing exception when PDF has unused empty fonts embedded.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, 2.0.2, 2.0.3
    • Fix Version/s: 2.0.3, 3.0.0 PDFBox
    • Component/s: FontBox
    • Labels:
      None

      Description

      I was trying to follow up on the issues in our system and found that some PDF files threw ERRORs. These PDFs are produced by a publishing system and that system seems to add fonts when you change to them and add them even though they are never used. Or only space is used. Then they add this font with an empty glyf table. This results in that errors are thrown on files that are fine.

      Line 310 in TTFParser removes empty glyf tables.
      // skip tables with zero length
      if (table.getLength() == 0)

      { return null; }

      return table;

      Line 215 of TTFParser throws exception when glyf table is missing.
      if (font.getGlyph() == null)

      { throw new IOException("glyf is mandatory"); }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tilman Tilman Hausherr
                Reporter:
                kalaspuffar Daniel Persson
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: