【问题标题】:Ghostscript font conversion issueGhostscript字体转换问题
【发布时间】:2012-03-01 19:39:50
【问题描述】:

全部,

我遇到了 pdf 中的字体问题。在原始文件中,它显示一条实线,但如果我复制它,我会在剪贴板上得到这个ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

这表明它使用了一些特殊的字体,这很好。问题是我将此pdf用作ghostscript的输入,并且该行变成了一堆带有X的框。

经过一番搜索,我发现了this answer-c 命令成功删除了这些框,但该行仍然丢失。

在 Windows 7 64 位系统上运行 gswin64c.exe -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf USA_15238-2897_5853101.pdf,我得到以下输出:

GPL Ghostscript 9.04 (2011-08-05)
Copyright (C) 2011 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 2.
Page 1
Substituting font Courier-Bold for CourierNew,Bold.
Loading NimbusMonL-Bold font from %rom%Resource/Font/NimbusMonL-Bold... 3825552 2503053 2085544
 779106 3 done.
Substituting font Courier for CourierNew.
Loading NimbusMonL-Regu font from %rom%Resource/Font/NimbusMonL-Regu... 3986304 2660967 2146096
 844377 3 done.
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-Regu font from %rom%Resource/Font/NimbusSanL-Regu... 4100320 2785188 2226832
 918025 3 done.
Page 2
Substituting font Courier-Bold for CourierNew,Bold.
Substituting font Courier for CourierNew.

将 windows 字体文件夹添加为字体路径开关允许查找字体,但不能修复行到框的问题

运行 gswin64c.exe -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf -c ".setpdfwrite <</NeverEmbed [ ]>> setdistillerparams" -f USA_15238-2897_5853101.pdf 会产生以下结果:

GPL Ghostscript 9.04 (2011-08-05)
Copyright (C) 2011 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 2.
Page 1
Substituting font Courier-Bold for CourierNew,Bold.
Loading NimbusMonL-Bold font from %rom%Resource/Font/NimbusMonL-Bold... 3825552 2503973 2105728
 793286 3 done.
Substituting font Courier for CourierNew.
Loading NimbusMonL-Regu font from %rom%Resource/Font/NimbusMonL-Regu... 3986304 2661903 2166280
 858469 3 done.
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-Regu font from %rom%Resource/Font/NimbusSanL-Regu... 4100320 2786124 2247016
 932205 3 done.
Page 2
Substituting font Courier-Bold for CourierNew,Bold.
Substituting font Courier for CourierNew.

但该行现在是 pdf 中的空格。如果我复制并粘贴它,我会得到─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─

我需要添加什么 ghostscript 开关才能使该行与原始 pdf 保持一致?

【问题讨论】:

    标签: fonts ghostscript embedded-fonts


    【解决方案1】:

    如果没有看到您的 PDF 文件,就不可能说出发生了什么。请注意,复制+粘贴不能保证有效,尤其是在 Ghostscript 转换为 PDF 之后。

    既然你已经有一个 PDF 文件,你为什么要把它转换成 PDF 呢?

    最可能的问题是将 Courier 替换为 Courier-New,但没有看到文件我无法确定。

    【讨论】:

    • 我正在使用 Ghostscript 来组合其中的几个 pdf。我不在乎复制和粘贴,我在乎外观。我刚刚提到了复制,因为它似乎表明正在使用 unicode 字体来生成线条,而不是矢量图形。我无法提供原始 pdf,因为它包含敏感数据。 CourierCourier-New 有什么区别?
    • 我会接受这个作为答案,因为它是 Courier 字体替换。感谢您为我指明正确的方向。
    • 但 Ghostscript 中修复 courier 字体替换的开关是什么?
    • 几乎可以肯定没有开关,但是如果 Courier-New 字体在必要的代码点具有正确的字形,则为 Courier-New 添加字体声明会起作用。请注意,Ghostscript 只会在输入文件中不存在字体并且您没有告诉它在哪里可以找到命名替代字体时替换字体。
    猜你喜欢
    • 2016-05-09
    • 2016-07-13
    • 2017-09-14
    • 1970-01-01
    • 1970-01-01
    • 2012-07-17
    • 2013-12-26
    • 2018-09-08
    • 1970-01-01
    相关资源
    最近更新 更多