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

Parse error reading embedded Type1 font

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.4
    • 2.0.5, 3.0.0 PDFBox
    • FontBox
    • FreeBSD, Openjdk 1.8.0_112, Scala 2.12.0

    Description

      Attached file works with Acrobat Reader, mupdf, pdftk, and so on.
      When using pdfbox to render first page to an image:

      16:01:13.042 [run-main-0] WARN o.a.pdfbox.pdmodel.font.PDType1Font - Using fallback font ArialMT for Frutiger
      16:01:13.047 [run-main-0] WARN o.a.pdfbox.pdmodel.font.PDType1Font - Using fallback font Arial-BoldMT for Frutiger45,Bold
      16:01:13.168 [run-main-0] ERROR o.a.pdfbox.pdmodel.font.PDType1Font - Can't read the embedded Type1 font KIX-Barcode-Regular
      java.io.IOException: unexpected closing parenthesis
      at org.apache.fontbox.type1.Type1Lexer.readToken(Type1Lexer.java:123)
      at org.apache.fontbox.type1.Type1Lexer.nextToken(Type1Lexer.java:75)
      at org.apache.fontbox.type1.Type1Parser.parseBinary(Type1Parser.java:468)
      at org.apache.fontbox.type1.Type1Parser.parse(Type1Parser.java:64)
      at org.apache.fontbox.type1.Type1Font.createWithSegments(Type1Font.java:85)
      at org.apache.pdfbox.pdmodel.font.PDType1Font.<init>(PDType1Font.java:262)
      at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:62)
      at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:143)
      at org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:60)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:829)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:486)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:460)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:150)
      at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:189)
      at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:145)
      at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:68)

      To reproduce (Scala, sorry, but straightforward to reproduce):

      val doc = new PDDocument.load(...)
      val renderer = new PDFRenderer(doc)
      val img = renderer.renderImage(0, 1.0f)

      Attachments

        1. KIX-Barcode-Regular.pfb
          28 kB
          Tilman Hausherr
        2. testcase2.pdf
          39 kB
          Dennis Noordsij

        Activity

          People

            tilman Tilman Hausherr
            dennisn Dennis Noordsij
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: