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

Could not read embedded TTF for font

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.21
    • 2.0.26, 3.0.0 PDFBox
    • FontBox
    • None

    Description

      Getting below warning  while  converting pdf to image using PDFBOX lib

      Our PDF is embedded with font GillSansStd-BoldItalic and others font and pdfbox not able to read them and Using fallback font 'TimesNewRomanPS-BoldItalicMT' for 'GillSansStd-BoldItalic' 

      Converted Image is not proper.

      How to resolve it.

       2022-02-16T14:07:48,311 WARN  pdf2img-worker-pdfbox-2: [org.apache.pdfbox.pdmodel.font.PDTrueTypeFont] [UNIQUE_ID:] [docId:296f1a68-ac74-469e-bf06-aebd42ac19f4] Could not read embedded TTF for font GillSansStd-BoldItalic2022-02-16T14:07:48,311 WARN  pdf2img-worker-pdfbox-2: [org.apache.pdfbox.pdmodel.font.PDTrueTypeFont] [UNIQUE_ID:] [docId:296f1a68-ac74-469e-bf06-aebd42ac19f4] Could not read embedded TTF for font GillSansStd-BoldItalicjava.io.IOException: loca is mandatory at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:209) ~[fontbox-2.0.21.jar:2.0.21] at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:150) ~[fontbox-2.0.21.jar:2.0.21] at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:106) ~[fontbox-2.0.21.jar:2.0.21] at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.<init>(PDTrueTypeFont.java:198) [pdfbox-2.0.21.jar:2.0.21] at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:89) [pdfbox-2.0.21.jar:2.0.21] at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:146) [pdfbox-2.0.21.jar:2.0.21] at org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:66) [pdfbox-2.0.21.jar:2.0.21] at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:933) [pdfbox-2.0.21.jar:2.0.21] at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:515) [pdfbox-2.0.21.jar:2.0.21] at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:489) [pdfbox-2.0.21.jar:2.0.21] at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:156) [pdfbox-2.0.21.jar:2.0.21] at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:272) [pdfbox-2.0.21.jar:2.0.21] at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:321) [pdfbox-2.0.21.jar:2.0.21] at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:243) [pdfbox-2.0.21.jar:2.0.21] at com.idemia.pdf2img.engine.pdfbox.PDFBOXEngine.renderPage(PDFBOXEngine.java:106) [pdf2img-engines-pdfbox-1.3.0-SNAPSHOT.jar:?] at com.idemia.pdf2img.core.services.rendering.RenderingService.engineRenderPage(RenderingService.java:545) [pdf2img-core-1.3.0-SNAPSHOT.jar:?] at com.idemia.pdf2img.core.services.rendering.RenderingService.renderPage(RenderingService.java:464) [pdf2img-core-1.3.0-SNAPSHOT.jar:?] at com.idemia.pdf2img.core.services.worker.PdfBOXConversionWorker.submitToEngineAndGetResult(PdfBOXConversionWorker.java:41) [pdf2img-core-1.3.0-SNAPSHOT.jar:?] at com.idemia.pdf2img.core.services.worker.AbstractConversionWorker.checkAndRenderLowPriority(AbstractConversionWorker.java:92) [pdf2img-core-1.3.0-SNAPSHOT.jar:?] at com.idemia.pdf2img.core.services.worker.AbstractConversionWorker.checkQueueAndRenderHighFirst(AbstractConversionWorker.java:63) [pdf2img-core-1.3.0-SNAPSHOT.jar:?] at com.idemia.pdf2img.core.services.worker.AbstractConversionWorker.listenToRenderingRequests(AbstractConversionWorker.java:53) [pdf2img-core-1.3.0-SNAPSHOT.jar:?] at com.idemia.pdf2img.core.services.worker.AbstractConversionWorker.run(AbstractConversionWorker.java:34) [pdf2img-core-1.3.0-SNAPSHOT.jar:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_192] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_192] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_192] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_192] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_192] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_192] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_192]2022-02-16T14:07:48,311 WARN  pdf2img-worker-pdfbox-2: [org.apache.pdfbox.pdmodel.font.PDTrueTypeFont] [UNIQUE_ID:] [docId:296f1a68-ac74-469e-bf06-aebd42ac19f4] Using fallback font 'TimesNewRomanPS-BoldItalicMT' for 'GillSansStd-BoldItalic'
      

      Attachments

        1. doc.pdf
          714 kB
          sumit gupta
        2. pdfbox.png
          92 kB
          sumit gupta
        3. screenshot-1.png
          36 kB
          Tilman Hausherr
        4. screenshot-2.png
          110 kB
          Tilman Hausherr

        Activity

          People

            tilman Tilman Hausherr
            gupta.sumit@idemia.com sumit gupta
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: