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

ClassCastException in PDTrueTypeFont.ensureFontDescriptor()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.2.0
    • Component/s: PDModel
    • Labels:
      None

      Description

      We're seeing an issue that seems to have been introduced in pdfbox 1.1.0:

      java.lang.ClassCastException: org.apache.pdfbox.pdmodel.font.PDFontDescriptorAFM cannot be cast to org.apache.pdfbox.pdmodel.font.PDFontDescriptorDictionary
      at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.ensureFontDescriptor(PDTrueTypeFont.java:167)
      at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.<init>(PDTrueTypeFont.java:117)
      at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:140)
      at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:76)
      at org.apache.pdfbox.pdmodel.PDResources.getFonts(PDResources.java:115)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:225)
      at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:207)
      at org.apache.pdfbox.util.PDFTextStripper.processPage(PDFTextStripper.java:367)
      at org.apache.pdfbox.util.PDFTextStripper.processPages(PDFTextStripper.java:291)
      at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:247)
      at org.apache.pdfbox.util.PDFTextStripper.getText(PDFTextStripper.java:180)
      ...

      So far, all affected pdf files are confidential. I'll add a test file later if I find one that can be made public. Hope the stack trace is sufficient though.

        Attachments

        1. PDTrueTypeFont.patch
          1 kB
          Villu Ruusmann

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                arjohn Arjohn Kampman
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: