Ghostscript's new PDF interpreter slower at embedding fonts? - Stack Overflow

We're using Ghostscript to embed fonts into PDF files and compress them at the same time. Recently

We're using Ghostscript to embed fonts into PDF files and compress them at the same time. Recently, when upgrading to Ghostscript 10, we noticed that the process took significantly longer than before. We were able to restore the old performance by adding -dNEWPDF=false, but of course that can only be a temporary fix.

This is our invocation (inspired by .ts#L242):

gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dEmbedAllFonts=true -dSubsetFonts=true -dColorImageDownsampleType=/Bicubic -dColorImageResolution=144 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=144 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=144 -sOutputFile=${output} ${input}

While trying to debug the issue, I noticed two differences between the output of the command with NEWPDF enabled and disabled:

  • The new interpreter outputs several warning: ignoring zlib error: incorrect data check messages to stderr that the old one doesn't.
  • Without -q, the old interpreter repeatedly writes messages like these:
Can't find (or can't open) font file /usr/share/ghostscript/10.00.0/Resource/Font//usr/sh.
Can't find (or can't open) font file ArialMT.
Loading ArialMT font from /usr/share/fonts/truetype/Arial.ttf... 8289900 6751216 7254872 5777824 4 done.

where the new one simply writes

Loading font ArialMT (or substitute) from /usr/share/ghostscript/10.00.0/Resource/Font/NimbusSans-Regular

Whether those differences are relevant or not, the new interpreter is consistently slower. Is there something we can do to speed it up?

We're running GS 10.0.0 on a Debian 12 system with the following fonts packages installed: fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742341166a4425654.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信