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

[PATCH] Two PDFont to create PDF documents in CJK and non-ISO-8859-1 languages

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • Writing
    • None

    Description

      I made two PDFont classes for creating PDF documents in CJK and non-ISO-8859-1 languages.

      One is PDType0CJKFont. This is for using CJK fonts included in the Asian font package of Adobe Reader. This font doesn't require the target font at the time of creating PDF documentary. This font uses UTF-16 as a text code and supports surrogate pair characters.

      The other is PDType0UnicodeFont. This is for using TrueType Type0 Font which can deal with any Unicode characters like a ArialUnicodeMS. Only the characters which are used actually in the document are embedde. Realizing this, you have to call the PDType0Unicode.reloadFont() method just before closing PDPageContentStream. I think this specification is ugly, but I could not thought of a suitable way to remove this spec. This font uses the original glyph code of the embedded font as a text code and supports surrogate pair characters too.

      Example programs using these two fonts are also attached.

      Attachments

        1. two-new-fonts.diff
          111 kB
          Keiji Suzuki
        2. Type0CJK.java
          1 kB
          Keiji Suzuki
        3. Type0Unicode.java
          1 kB
          Keiji Suzuki
        4. cidtype0.diff
          16 kB
          Keiji Suzuki
        5. Type0.java
          1.0 kB
          Keiji Suzuki
        6. type0bom.pdf
          387 kB
          Keiji Suzuki
        7. type0nobom.pdf
          387 kB
          Keiji Suzuki
        8. cidtype2.diff
          14 kB
          Keiji Suzuki
        9. PDCIDFontType2.patch
          0.7 kB
          Keiji Suzuki
        10. format14.patch
          0.7 kB
          Keiji Suzuki
        11. check-embeddability.patch
          2 kB
          Keiji Suzuki

        Issue Links

          Activity

            People

              jahewson John Hewson
              zuki_ebetsu Keiji Suzuki
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: