Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: None
    • Component/s: PDModel, Rendering
    • Labels:
    • Environment:

      Description

      Subtype is parsed as "Type0" by PDFBox, but parsed as "Type1" by Adobe Reader.
      This is not a bug of PDFBox.
      The reason is TCPDF 4.5.041 generate font AdobeSongStd-Light with bad subtype "Type0".
      It should be "Type1".

      I have test the following codes and they work.
      File: org/apache/pdfbox/pdmodel/font/PDFontFactory.java
      Method: public static PDFont createFont( COSDictionary dic ) throws IOException

      Original:
      else if( subType.equals( COSName.TYPE0 ) )
      {
      retval = new PDType0Font( dic );
      }

      Fixed:
      else if( subType.equals( COSName.TYPE0 ) )
      {
      COSName encoding = (COSName)dic.getDictionaryObject(COSName.ENCODING);
      retval = (encoding!=null) ? new PDType1Font( dic ) : new PDType0Font( dic );
      }

      With such patch PDFBox will act like Adobe Reader.

        Attachments

        1. pdf-screenshot.png
          85 kB
          Raymond Wu
        2. page-08.pdf
          238 kB
          Raymond Wu
        3. adobe-screenshot.png
          227 kB
          Raymond Wu

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              raymondwu Raymond Wu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: