繁体   English   中英

找出哪些 pdf 文件缺少字体

[英]Find out which pdf files have missing fonts

我有 10.000 个 pdf,其中一些缺少字体。 我已经找到了如何使用 ghostscript 将缺少的字体添加到 pdf 中:

>gswin64 -sFONTPATH=path_to_fonts -o path_topdf_2 -sDEVICE=pdfwrite -dPDEFSETTINGS=/prepress path_to_pdf

但是,这也会更改不会导致任何问题的 pdf 文件并在之后调整它们的大小。 在生成 10.000 个新 pdf 之前,我想通过循环找出哪些 pdf 不包含特定字体并仅重新创建这些 pdf。 这是否可以使用 ghostscript 或 C# 库?

您可以使用Xpdf 中pdffonts.exe命令行工具。

示例输出:

pdffonts -loc zzz.pdf
Config Error: No display font for 'Symbol'
Config Error: No display font for 'ZapfDingbats'
name                                           type              emb sub uni prob object ID location
---------------------------------------------- ----------------- --- --- --- ---- --------- --------
FPLBLO+TimesNewRomanPS-BoldMT                  Type 1C           yes yes yes        1362  0 embedded
FPLBNP+TimesNewRomanPSMT                       Type 1C           yes yes yes        1363  0 embedded
FPLCEN+Arial-BoldMT                            Type 1C           yes yes yes        1833  0 embedded
FPLCHN+TimesNewRomanPS-ItalicMT                Type 1C           yes yes yes        1844  0 embedded

编写脚本或C#程序,为您的每个文件调用pdffonts.exe并检查输出中是否缺少字体。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM