【发布时间】:2019-04-09 19:47:13
【问题描述】:
我有一个过程需要将多个 postscript 和 pdf 文件写入由 word interop VB 代码生成的单个 postscript 文件,并将继续由 word interop VB 代码修改。每次调用 ghostscript 都会产生一个额外的空白页。我正在使用 GhostScript 9.27。
由于这里有多种技术和因素,我将其范围缩小:可以通过将 postscript 文件转换为 postscript,然后通过命令行转换为 pdf 来证明问题。直接从 postscript 到 pdf 不会发生此问题。这是一个示例和错误示例。
C:\>"C:\Program Files (x86)\gs\gs9.27\bin\gswin32c.exe" -dNOPAUSE -dBATCH -sDEVICE=ps2write -sOutputFile=C:\testfont.ps C:\smallexample.ps
C:\>"C:\Program Files (x86)\gs\gs9.27\bin\gswin32c.exe" -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=C:\testfont.pdf C:\testfont.ps
Can't find (or can't open) font file %rom%Resource/Font/TimesNewRomanPSMT.
Can't find (or can't open) font file TimesNewRomanPSMT.
Can't find (or can't open) font file %rom%Resource/Font/TimesNewRomanPSMT.
Can't find (or can't open) font file TimesNewRomanPSMT.
Querying operating system for font files...
Didn't find this font on the system!
Substituting font Times-Roman for TimesNewRomanPSMT.
我开始假设字体错误是导致额外页面的原因(如果只是为了排除这种情况,我知道这不确定)。由于我的 ps->pdf 测试没有出现这个问题,而我的 ps->ps->pdf 确实出现了这个问题,我认为 ghostscript 没有将原始 postscript 文件中的字体数据写入它正在创建的文件中。我正在寻找一种在生成的 postscript 文件中保留/重新创建它的方法。或者,如果这不可能,我需要一种方法来告诉 ghostscript 如何使用这些字体。我没有成功尝试按照此处的 GS 文档中所述包含它们:https://www.ghostscript.com/doc/current/Use.htm#CIDFontSubstitution。
感谢任何帮助。
【问题讨论】:
标签: pdf ghostscript postscript