【问题标题】:Ghostscript merge pdf font error: How to define fallback fontGhostscript合并pdf字体错误:如何定义后备字体
【发布时间】:2016-11-23 00:18:35
【问题描述】:

如果找不到字体,你如何告诉 ghostscript 使用“后备”字体?

执行此 Ghostscript 命令时:

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/output.pdf /input_pdf_with_missing_font.pdf

我收到此错误:

错误:/undefined in findresource 操作数堆栈:--dict:9/18(L)-- C2_0 1 --dict:6/6(L)-- --dict:6/6(L)-- ArialUnicodeMS --dict:11/12(ro)(G)-- --nostringval-- CIDFontObject --dict:8/8(L)-- --dict:8/8(L)-- Adob​​e-Identity 执行堆栈:%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 3 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue -- nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %loop_continue 字典堆栈:--dict:1149/1684(ro)(G)-- --dict:1/20 (G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict: 106/127(ro)(G)-- --dict:286/300(ro)(G)-- --dict:22/25(L)-- --dict:4/6(L)-- --dict:26/40(L)-- 当前分配模式是本地的 Last OS error: 2 GPL Ghostscript 8.70: Unrecoverable error, exit code 1

【问题讨论】:

  • 我已经安装了8.70版
  • CentOS 6.8版

标签: pdf fonts ghostscript


【解决方案1】:

您需要更新版本的 Ghostscript(如果您说明正在使用的版本,它将有助于解决这类问题)。

您使用的似乎是 8.70 版,现在已经有 7 年多了,当前版本是 9.20。当前版本附带默认 CIDFont(您的 PDF 文件无法嵌入 CIDFont,而不是字体)。

您必须查看 Ghostscript 8.70 提供的文档以了解如何定义替代资源(请参阅 Ghostscript 安装文件夹,然后是“doc”子文件夹),我不记得当前方法是否适用于这样一个古老的版本。不过目前关于 CIDFont 替换的版本文档也可以在here找到。

【讨论】:

  • Ghostscript for Centos 6.8 for yum/rpm 的版本是 8.70
  • 是的,我猜这就是你使用 CentOS 所得到的,旧应用程序。我想我们应该感谢它从这个千年。你可以自己下载和构建 Ghostscript,或者叫 CentOS 的人升级他们的包。或者尝试找出如何使用旧文档使用旧版本的 Ghostscript 进行 CIDFont 替换,并且缺少替换 CIDFont 和相关支持文件。我个人会升级。
【解决方案2】:

我接受了@KenS 的建议并将 Ghostscript 安装到 9.20(我想为其他遗留项目保留旧版本)

这里是步骤(我按照这些instructions):

找到GS的源码包:https://github.com/ArtifexSoftware/ghostpdl-downloads/releases

就我而言:https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs920/ghostscript-9.20.tar.gz

运行以下命令:

光盘 /tmp wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs920/ghostscript-9.20.tar.gz tar xzf ghostscript-9.20.tar.gz cd ghostscript-9.20 ./configure --prefix=/usr/bin/gs9 制作 须藤使安装

并运行新版本:

/usr/bin/gs9/bin/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/some/target/file.pdf /some/source/file.php

再也没有字体问题了!!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-13
    • 2012-09-08
    • 2017-04-30
    • 1970-01-01
    • 2016-02-08
    • 2016-10-18
    • 1970-01-01
    • 2016-05-09
    相关资源
    最近更新 更多