【发布时间】:2014-10-25 11:19:04
【问题描述】:
我正在使用 Ghostscript (9.14) 在使用 pdfwrite 驱动程序分发之前“清理” PDF 虽然它通常工作得很好,但我注意到它经常重新编码嵌入式字体,通常有防止用于搜索等的合理文本提取的效果。
ghostscript 处理之前的示例文件在这里:http://download.vistair.com/ghostscript/in.pdf 用ghostscript处理后的结果在这里:http://download.vistair.com/ghostscript/out.pdf
可以使用输入文件提取合理的文本,但不能使用输出文件。
查看 PDF,在我们的输入文件中:
obj 9 0
Type: /Font
Referencing: 12 0 R, 14 0 R
<<
/BaseFont /GCCBBY+TT187t00
/Encoding 12 0 R
/FirstChar 1
/FontDescriptor 14 0 R
/LastChar 41
/Subtype /TrueType
/Type /Font
/Widths [352 684 633 973 596 427 636 636 636 636 751 632 684 616 695 787 989 421 748 686 575 601 521 633 521 394 274 607 633 623 623 274 352 364 698 623 623 592 592 592 636]
>>
obj 12 0
Type: /Encoding
Referencing:
<<
/BaseEncoding /WinAnsiEncoding
/Differences [1/space/S/u/m/e/r/two/zero/one/four/H/E/A/T/R/O/W/I/N/B/F/a/c/h/s/t/i/o/n/p/b/l/f/period/C/d/g/y/v/k/endash]
/Type /Encoding
>>
在 ghostscript 处理的文件中,这变成了:
obj 8 0
Type: /Font
Referencing: 9 0 R
<<
/BaseFont /OWPYKO+TT187t00
/FontDescriptor 9 0 R
/Type /Font
/FirstChar 2
/LastChar 6
/Widths [ 684 633 973 596 427]
/Subtype /TrueType
>>
所以字体编码信息已经丢失,文本不再可提取。
有没有办法停止 ghostscript 重新编码现有的嵌入字体(或至少保留任何现有的字体编码)?
【问题讨论】:
标签: pdf fonts ghostscript