如何让 Ghostscript 在 PDF 中使用嵌入字体

编程入门 行业动态 更新时间:2024-10-27 23:16:46
本文介绍了如何让 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 中使用嵌入字体

本文发布于:2023-10-30 01:21:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1541346.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字体   Ghostscript   PDF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!