如何让 Ghostscript 在 PDF 中使用嵌入字体 [英] How to get Ghostscript to use embedded fonts in PDF

查看:56
本文介绍了如何让 Ghostscript 在 PDF 中使用嵌入字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

gs -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH 
   -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf

我正在使用(无论如何都在尝试)使用 Ghostscript 来减小我的 PDF 文件大小.上面的命令看起来很有效,它大大减少了文件大小,但随后有几个字段是乱码.至于我可以追踪它,它正在做字体替换.IE,相同的文字 = 相同的乱码.

I'm using (trying anyway) to use Ghostscript to reduce my PDF file size. The command above looks like it works, it reduces file size greatly, but then several of the fields are garbled. As for as I can track it down, It's doing font substitution. IE, The same text = same garbled text.

当我找到 PDF 时,字体已嵌入其中.此外,我尝试将所有字体添加到 Fontmap.

The fonts are embedded in the PDF when it gets to me. Additionally, I have tried to add all the fonts to the Fontmap.

任何想法,理想情况下,我希望它使用嵌入的字体,而不必更新 gs 系统字体/编辑字体映射等.我使用的是 Ubuntu 9.10,嵌入的字体是 Windows 字体、Arial/TimesNewRoman.

Any ideas, Ideally I would like it to use the embedded fonts without me having to update the gs system fonts/edit fontmap, etc. I'm using Ubuntu 9.10 and the Fonts embedded are windows fonts, Arial/TimesNewRoman.

谢谢.

推荐答案

追溯嵌入未嵌入原始 PDF 的字体确实会增加文件大小,而不是减小文件大小.

Embedding fonts retrospectivly which were not embedded in the original PDF does increase the file size, not decrease it.

但是,仍有可能通过降低嵌入图像的分辨率来减小整体文件大小...取决于您的偏好和需求.

However, there may still be a chance to reduce the overall file size by reducing the resolution of embedded images... depends on your preferences and needs.

您可以尝试使用以下命令行的变体.它将嵌入所有字体(甚至是Base 14"字体),但仅嵌入所需的字形(原始字体的子集"),并压缩字体:

You can try with variations of the following commandline. It will embed all fonts (even the "Base 14" ones), but embed required glyphs only (a "subset" of the original font), and also compress the fonts:

gs 
   -dCompatibilityLevel=1.4 
   -dPDFSETTINGS=/screen 
   -dCompressFonts=true 
   -dSubsetFonts=true 
   -dNOPAUSE 
   -dBATCH 
   -sDEVICE=pdfwrite 
   -sOutputFile=output.pdf 
   -c ".setpdfwrite <</NeverEmbed [ ]>> setdistillerparams" 
   -f input.pdf

这篇关于如何让 Ghostscript 在 PDF 中使用嵌入字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆