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

The embedded font DroidSansFallbackFull reports an error when parsing, and finally uses lastResortFont, resulting in garbled fonts.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.30
    • 2.0.31, 3.0.2 PDFBox, 4.0.0
    • FontBox
    • None

    Description

      demo:

      public static void main(String[] args) throws IOException, InterruptedException {
      File file = new File("C:\\Users\\LYCIT\\Downloads
      CMISG Mutual NDA_Enepath_09Nov23_signed6.pdf");
      final PDDocument load = PDDocument.load(file, MemoryUsageSetting.setupTempFileOnly()
      .setTempDir(new File("D:\\fcs
      test")));

      PDFRenderer renderer = new PDFRenderer(load);
      renderer.setSubsamplingAllowed(true);
      int pageIndex = 0;
      float scale = 2f;
      BufferedImage bufferedImage = renderer.renderImage(pageIndex, scale, ImageType.RGB);
      FileOutputStream fos = null;
      try

      { fos = new FileOutputStream(new File("D:\\fcs\\test/test6/image" + pageIndex + ".jpg")); ImageIO.write(bufferedImage, "jpg", fos); }

      finally {
      if (fos != null)

      { fos.close(); }

      }
      Thread.sleep(6000000);
      }

      pdf:CMISG Mutual NDA_Enepath_09Nov23_signed6.pdf

      garbled fonts:image0.jpg

      Attachments

        1. image-2024-01-07-13-19-32-380.png
          43 kB
          Tilman Hausherr
        2. droid-bad.ttf
          5 kB
          Tilman Hausherr
        3. image0.jpg
          41 kB
          liu
        4. CMISG Mutual NDA_Enepath_09Nov23_signed6.pdf
          629 kB
          liu

        Activity

          People

            tilman Tilman Hausherr
            lycheng liu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: