Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to know using this tool if a font is embedded and has to_unicode map? #36

Open
kfcaio opened this issue Jul 31, 2021 · 1 comment
Labels
poppler-cpp Need to be fixed upstream question Further information is requested

Comments

@kfcaio
Copy link

kfcaio commented Jul 31, 2021

The workflow of one of my scripts relies on calling subprocess.run for each pdf page to get its respective pdffonts output. Those calls are expensive, so I'm looking forward to better ways to identify likely problematic fonts from font name, enconding, "embeddedness" and unicode conversion.

Example of pdffonts output:

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
DIIEDG+Arial                         CID TrueType      Identity-H       yes yes no   51834  0
DIIEDH+Arial                         CID TrueType      Identity-H       yes yes no   51831  0
DIIDPF+ArialMT                       CID TrueType      Identity-H       yes yes yes  51824  0
DIIEBG+TimesNewRomanPSMT             CID TrueType      Identity-H       yes yes yes  51821  0
[none]                               Type 3            Custom           yes no  no   51861  0
Arial                                TrueType          WinAnsi          yes no  no   67975  0

Is it possible to extract those informations just with poppler backend used here? I just took a look at the source code and I've not found something like that.

Thanks in advance,

@cbrunet
Copy link
Owner

cbrunet commented Aug 12, 2021

From the document, you can get the list of fonts.

For each font, you can get its name, its type, its embeddedness, its file name, and if a subset is embedded in the document. See https://poppler.freedesktop.org/api/cpp/classpoppler_1_1font__info.html

However,encoding and unicode conversion are not exposed in the cpp backend. You may request upstream to add them.

@cbrunet cbrunet added question Further information is requested poppler-cpp Need to be fixed upstream labels Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
poppler-cpp Need to be fixed upstream question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants