模仿Adobe Acrobats"打印到PDF"使用Ghostscript

时间:2016-10-03 03:23:38

标签: pdf pdf-generation ghostscript

我正在编写一个批处理文件来模拟手动任务,即使用Acrobat打开文件夹中的每个PDF,然后打印到PDF。

手动任务的目标是获得统一的8-1 / 2 x 11页面大小以及压缩的压缩文件大小。

到目前为止我写的内容确实没什么问题,但是在一些较大的PDF上,脚本的结果远远大于打印到PDF的结果。

这是我到目前为止所做的:

 ECHO attempting compression subroutine... >>"%log%"
 cd %GS_DIR%

gswin64c.exe ^
  -o "%drive%%filepath%%name%-c.pdf"       ^
  -sDEVICE=pdfwrite                        ^
  -sPAPERSIZE=letter                       ^
  -dFitPage                                ^
  -dCompressPages=true                     ^
  -dCompressFonts=true                     ^
  -dDownsampleColorImages=true             ^
  -dDownsampleGrayImages=true              ^
  -dDownsampleMonoImages=true              ^
  -dColorImageResolution=300               ^
  -dGrayImageResolution=300                ^
  -dMonoImageResolution=300                ^
  -dColorImageDownsampleThreshold=1.0      ^
  -dGrayImageDownsampleThreshold=1.0       ^
  -dMonoImageDownsampleThreshold=1.0       ^
  -dProcessColorModel=/DeviceGray          ^
  -dColorConversionStrategy=/Gray          ^
  -dColorConversionStrategyForImages=/Gray ^
  -dCompatibilityLevel=1.4                 ^
  -dEmbedAllFonts=false                    ^
  -c ".setpdfwrite <</AlwaysEmbed [ ] /NeverEmbed [/Courier /Courier-Bold /Courier-Oblique /Courier-BoldOblique /Helvetica /Helvetica-Bold /Helvetica-Oblique /Helvetica-BoldOblique /Times-Roman /Times-Bold /Times-Italic /Times-BoldItalic /Symbol /ZapfDingbats] /ColorImageFilter /DCTEncode /GrayImageFilter /DCTEncode /MonoImageFilter /CCITTFaxEncode /OutputICCProfile (None)>> setdistillerparams" ^
  -f %fullpath%

ECHO compression complete, cleaning up files... >>"%log%"

我认为这个问题可能与字体有关,但我不确定如何修复它,这是一个来自其中一个文件的常见消息,而ghost脚本运行:

Can't find (or can't open) font file %rom%Resource/Font/ArialMT.
Can't find (or can't open) font file ArialMT.
Can't find (or can't open) font file %rom%Resource/Font/ArialMT.
Can't find (or can't open) font file ArialMT.
Querying operating system for font files...
Didn't find this font on the system!
Substituting font Helvetica for ArialMT.
Loading NimbusSanL-Reg font from %rom%Resource/Font/NimbusSanL-Reg... 4826216 3500251 7703168 6115407 3 done.
Can't find (or can't open) font file %rom%Resource/Font/Arial-BoldMT.
Can't find (or can't open) font file Arial-BoldMT.
Can't find (or can't open) font file %rom%Resource/Font/Arial-BoldMT.
Can't find (or can't open) font file Arial-BoldMT.
Didn't find this font on the system!
Substituting font Helvetica-Bold for Arial-BoldMT.
Loading NimbusSanL-Bol font from %rom%Resource/Font/NimbusSanL-Bol... 5025328 3699533 7797072 6194808 3 done.

有关更好参数的任何想法,以模拟Print-To-PDF行为?

0 个答案:

没有答案