You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何生成未嵌入CID TrueType字体的PDF示例文件?

创建含非嵌入CID TrueType字体的PDF复现文件指南需求

背景

调试PDF处理生产问题时,需复现客户文件的字体特性,该文件字体信息如下:

$ pdffonts broken.pdf
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
Times New Roman,Bold                 CID TrueType      Identity-H       no  no  yes      3  0
Times New Roman,Bold                 CID TrueType      Identity-H       no  no  yes      4  0
Times New Roman                      CID TrueType      Identity-H       no  no  yes      5  0
Times New Roman                      CID TrueType      Identity-H       no  no  yes     10  0
Arial,Bold                           CID TrueType      Identity-H       no  no  yes     11  0
$

因无法分享原文件,需创建字体特性一致的最小复现PDF。

现有尝试及问题

编写了sample.ps文件:

%!PS
/Arial
20 selectfont
72 700 moveto
(A summer river being crossed) show

/Times-Roman
20 selectfont
72 650 moveto
(how pleasing) show

/Times-Bold
20 selectfont
72 600 moveto
(with sandals in my hands!) show
showpage

通过Ghostscript生成PDF:

$ gs -sDEVICE=pdfwrite -dEmbedAllFonts=false -o output.pdf sample.ps
# ...
Loading ArialMT font from /System/Library/Fonts/Supplemental/Arial.ttf... 5145024 3571205 11691560 8060049 1 done.
Loading NimbusRoman-Regular font from /usr/local/Cellar/ghostscript/10.01.2/share/ghostscript/10.01.2/Resource/Font/NimbusRoman-Regular... 5206968 3755189 11733704 8112801 1 done.
Loading NimbusRoman-Bold font from /usr/local/Cellar/ghostscript/10.01.2/share/ghostscript/10.01.2/Resource/Font/NimbusRoman-Bold... 5313448 3956352 11733704 8116398 1 done.
$

生成的PDF字体类型不符合要求:

$ pdffonts output.pdf
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
Times-Roman                          Type 1            Standard         no  no  no       9  0
Times-Bold                           Type 1            Standard         no  no  no      10  0
Arial                                TrueType          Standard         no  no  yes      7  0
$

问题

请问有哪些方法可以模拟原文件的字体特性(使用非嵌入的CID TrueType字体,编码为Identity-H)?

内容的提问来源于stack exchange,提问作者oldhomemovie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.16 09:47:13