Tim*_*Tim 1 fonts pdf ghostscript
我有一个 pdf 文件,其文本可以在 evince 中正确显示,但在文本被搜索或复制并粘贴到文件外时则不能。例如,“对外运输”。被复制并粘贴到外面
2D/28:93 /89:4758/9/.5:
我从正常工作的 pdf 文件的原始版本创建了 pdf 文件,通过
gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=example.pdf original.pdf
Run Code Online (Sandbox Code Playgroud)
该命令是我修复 pdf 文件中各种问题的通用方法(尤其是在 Windows 上创建的 pdf 文件中的字体问题)。
谢谢。
我在 Stack Overflow ( 1 , 2 , 3 )上做了一些阅读和一些有用的帖子,似乎表明问题出在您的 PDF 文件中嵌入的特定字体。您的原始文件使用这些字体:
$ pdffonts original.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
KPSHBO+Wingdings TrueType Custom yes yes no 5 0
KNQZHK+Arial TrueType Custom yes yes no 9 0
YLWHHJ+TimesNewRoman TrueType Custom yes yes no 13 0
HWNDJR+ArialBlack TrueType Custom yes yes no 17 0
QQRMEC+TimesNewRoman,Bold TrueType Custom yes yes no 21 0
Run Code Online (Sandbox Code Playgroud)
我猜测(但不确定)该问题很可能是由 Wingdings 字体引起的。大概你的系统上没有它。至少,在列出的字体中,这是我唯一找不到的字体:
$ fc-list | grep -f <(pdffonts original.pdf | grep -oP '\+\K[A-Z][a-z]+') | awk '{print $1}'
/usr/share/fonts/TTF/times.ttf:
/usr/share/fonts/TTF/arialbd.ttf:
/usr/share/fonts/TTF/ariblk.ttf:
/usr/share/fonts/TTF/arialbi.ttf:
/usr/share/fonts/TTF/ariali.ttf:
/usr/share/fonts/TTF/timesi.ttf:
/usr/share/fonts/TTF/timesbd.ttf:
/usr/share/fonts/TTF/timesbi.ttf:
/usr/share/fonts/TTF/arial.ttf:
Run Code Online (Sandbox Code Playgroud)
不幸的是,我尝试从这里下载 Wingdings 字体,然后运行:
unzip wingdings.zip
sudo cp Wingdings\ Regular.ttf /usr/share/fonts/TTF/Wingdings.ttf
fc-cache
Run Code Online (Sandbox Code Playgroud)
哪个应该安装了字体,但gs
命令仍然不起作用。所以也许gs
'spdfwrite
根本无法处理这种字体。所以我不知道是否有办法gs
正确转换您的文件。也许简单地使用没有这个问题的原件是你唯一的选择。