What are the extra characters in the font name of my PDF?

前端 未结 2 1855
滥情空心
滥情空心 2020-12-03 19:53

while extracting font name from pdf i will get some junk characters followed by plus sign and then the font name with font style. i want to remove the junk characters.only f

相关标签:
2条回答
  • For an explanation have a look at section 9.6.4 Font Subsets of the PDF specification ISO 32000-1:2008:

    For a font subset, the PostScript name of the font — the value of the font’s BaseFont entry and the font descriptor’s FontName entry — shall begin with a tag followed by a plus sign (+). The tag shall consist of exactly six uppercase letters; the choice of letters is arbitrary, but different subsets in the same PDF file shall have different tags.

    EXAMPLE EOODIA+Poetica is the name of a subset of Poetica®, a Type 1 font.

    Thus, those characters aren't junk, they are a tag.

    0 讨论(0)
  • 2020-12-03 20:49

    The "junk" characters indicate that the font isn't embedded completely. You'll find names such as ABC123+RemingtonNoiseless, XYZ456+RemingtonNoiseless, etc... meaning that there may be different subsets of the same font inside the PDF.

    For an explanation have a look at section 9.6.4 Font Subsets of the PDF specification ISO 32000-1:2008:

    For a font subset, the PostScript name of the font — the value of the font’s BaseFont entry and the font descriptor’s FontName entry — shall begin with a tag followed by a plus sign (+). The tag shall consist of exactly six uppercase letters; the choice of letters is arbitrary, but different subsets in the same PDF file shall have different tags.

    EXAMPLE EOODIA+Poetica is the name of a subset of Poetica®, a Type 1 font.

    In other words: these characters aren't merely "junk". If you want to remove them, that's a no-brainer, just use the appropriate string manipulation method, but be aware that removing them throws away information that may be useful in some contexts.

    0 讨论(0)
提交回复
热议问题