我试图在Linux上呈现此pdf,但是生成的png显示缺少字体块。
gs -sDEVICE=png16m -o test.png AGREE\ II\ lijst.pdf

pdf是在Mac上生成的(使用其print to pdf功能),并包含嵌入式字体:
$> pdffonts AGREE\ II\ lijst.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
EFPVPD+ArialMT TrueType MacRoman yes yes no 12 0
RFRCNT+TimesNewRomanPSMT TrueType MacRoman yes yes no 10 0
FLZUKV+Arial-BoldMT TrueType MacRoman yes yes no 11 0
VQHCHW+Arial-ItalicMT TrueType MacRoman yes yes no 13 0evince和qpdfview可以很好地显示pdf,但是打印失败,可能是因为我的计算机使用相同的幽灵脚本将pdf呈现为位图。
我将非常感谢你的帮助。
$> gs -help
GPL Ghostscript 9.22 (2017-10-04)
Copyright (C) 2017 Artifex Software, Inc. All rights reserved.
Usage: gs [switches] [file1.ps file2.ps ...]
Most frequently used switches: (you can use # in place of =)
-dNOPAUSE no pause after page | -q `quiet', fewer messages
-g<width>x<height> page size in pixels | -r<res> pixels/inch resolution
-sDEVICE=<devname> select device | -dBATCH exit after last file
-sOutputFile=<file> select output file: - for stdout, |command for pipe,
embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PostScriptLevel3 PDF
Default output device: x11alpha
Available devices:
alc1900 alc2000 alc4000 alc4100 alc8500 alc8600 alc9100 ap3250 atx23
atx24 atx38 bbox bit bitcmyk bitrgb bitrgbtags bj10e bj10v bj10vh bj200
bjc600 bjc800 bjc880j bjccmyk bjccolor bjcgray bjcmono bmp16 bmp16m
...
plibk plibm png16 png16m png256 png48 pngalpha pnggray pngmono pngmonod
pnm pnmraw ppm ppmraw pr1000 pr1000_4 pr150 pr201 ps2write psdcmyk
psdcmykog psdrgb pwgraster pxlcolor pxlmono r4081 rinkj rpdl samsunggdi
...
xpswrite
Search path:
/usr/share/ghostscript/9.22/Resource/Init :
/usr/share/ghostscript/9.22/lib :
/usr/share/ghostscript/9.22/Resource/Font :
/usr/share/ghostscript/fonts : /usr/share/fonts/Type1 : /usr/share/fonts
Ghostscript is also using fontconfig to search for font files
For more information, see /usr/share/ghostscript/9.22/doc/Use.htm.
Please report bugs to bugs.ghostscript.com.我甚至在我的电脑上安装了字体:
$> fc-list : family | egrep -i arial\|times
Times New Roman
Times
Arial发布于 2018-03-19 12:13:52
Ghostscript 9.22构建于Fedora 23上的标记发布源(目前可在表这里底部找到),它按照我的期望呈现文件。
因此,它很可能不是“Linux上的gs9.22”,它是Ghostscript 9.22构建在我的Linux风格上,它是由我正在使用的Linux发行版上的包维护人员编译的,这很可能是错误的。
这其中可能有许多的原因。首先,各种发行版都将自己的补丁应用到Ghostscript源树中。其次,软件包坚持使用系统共享库,而不是Ghostscript源代码附带的第三方库源。我们,Ghostscript开发团队,知道的这些工作,因为这就是我们测试的内容。我们不能测试所有随附于Linux风格的系统库的所有可能版本(和补丁),而且您可能遇到了某种不兼容(很可能是在FreeType中使用它的字体)。
请注意,您所看到的不是“缺少字体块”,而是缺少符号。这是/.notdef字形,当字形不在字体中时,它被用来代替字形呈现。在呈现文件时,您还没有给出Ghostscript的反向通道输出,如果缺少字体,就会出现一些警告。
我建议您从上面的链接中获取Ghostscript源代码,或者使用Git获取最新的源代码。自己建立它(你需要gcc,制造和自动工具安装),并测试这一点。如果这不起作用,那么请提交一个bug报告这里 --请务必描述如何构建Ghostscript,指定您使用的命令行,并将违规文件附加到bug报告中。
在同一个位置有一个预先构建的Linux二进制文件,您可以尝试这样做,但是它很有可能无法在您的Linux上工作。
顺便说一句,在您的系统上使用字体根本没用,因为PDF文件中的字体是子集和重新编码的。基本上没有办法使用系统字体来替换嵌入在PDF文件中的字体,解释器必须使用嵌入的字体。
https://stackoverflow.com/questions/49361230
复制相似问题