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

Apache PDFBox {2.0.6,2.0.7} java.lang.NoSuchMethodError: org.apache.fontbox.ttf.TrueTypeFont.getOriginalDataSize()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0.6, 2.0.7
    • Fix Version/s: None
    • Component/s: FontBox
    • Labels:
      None
    • Environment:
      Oracle Linux Server 6.8, Sun/Oracle Java SE JDK 1.8.0_141, jetty-8.1.12.v20130726, ActiveWeb-1.15
    • Flags:
      Important

      Description

      The following exception occurs during PDF generation using Apache PDFBox. It appears to be caused because Apache PDFBox

      {2.0.7,2.0.6}

      is bundled with and uses dependent library Apache FontBox org.apache.pdfbox:fontbox:bundle:2.0.7, of which class org.apache.fontbox.ttf.TrueTypeFont does not include the implementation for getOriginalDataSize(), although it is documented in the API docs.

      java.lang.NoSuchMethodError: org.apache.fontbox.ttf.TrueTypeFont.getOriginalDataSize()J
      at org.apache.pdfbox.pdmodel.font.TrueTypeEmbedder.buildFontFile2(TrueTypeEmbedder.java:117)
      at org.apache.pdfbox.pdmodel.font.PDCIDFontType2Embedder.buildSubset(PDCIDFontType2Embedder.java:106)
      at org.apache.pdfbox.pdmodel.font.TrueTypeEmbedder.subset(TrueTypeEmbedder.java:319)
      at org.apache.pdfbox.pdmodel.font.PDType0Font.subset(PDType0Font.java:176)
      at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1270)
      at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1249)
      at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1237)
      ...

      The web application source code does not directly call this method, so it is an internal dependent call made by Apache PDFBox.

      This is a runtime error only, no related errors observed during the build process.

      This issue first appears in Apache PDFBox 2.0.6 and is not present in Apache PDFBox 2.0.5.

      Current workaround is to downgrade Apache PDFBox to 2.0.5, which temporarily solves the problem until the bundled Apache FontBox can be fixed.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shara Sergei Haramundanis
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: