簡體   English   中英

使用 Ghostscript 從 PDF 轉換為 PCL 時重音字的錯誤字符

[英]Wrong characters for accented words when converting from PDF to PCL with Ghostscript

我正在嘗試使用 Ghostscript 將一些 PDF 文件(使用 FastReports 生成)轉換為 PCL,效果很好,只是帶有重音符號的單詞顯示錯誤字符。

這就是我所說的ghostscript:

bin\gswin32c -dBATCH -dNOPAUSE -sDEVICE=pxlmono -sFONTPATH=C:\Windows\Fonts -dDuplex -dFirstPage=1 -dLastPage=2 -sOutputFile=Parte.pcl -fParte.pdf

這是我的原始 PDF: 在此處輸入圖像描述

這是結果 PCL: 在此處輸入圖像描述

我想問題出在字體上,因為它說它找不到 Arial 和 Verdana 字體(盡管它們都安裝在 \Windows\Fonts 上)。

GPL Ghostscript 9.27 (2019-04-04)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Processing pages 1 through 2.
Page 1
Can't find CID font "Verdana".
Attempting to substitute CID font /Adobe-Identity for /Verdana, see doc/Use.htm#CIDFontSubstitution.
The substitute CID font "Adobe-Identity" is not provided either. attempting to use fallback CIDFont.See doc/Use.htm#CIDFontSubstitution.
Loading a TT font from %rom%Resource/CIDFSubst/DroidSansFallback.ttf to emulate a CID font Adobe-Identity ... Done.
Can't find CID font "Verdana".
Attempting to substitute CID font /Adobe-Identity for /Verdana, see doc/Use.htm#CIDFontSubstitution.
Can't find CID font "Verdana".
Attempting to substitute CID font /Adobe-Identity for /Verdana, see doc/Use.htm#CIDFontSubstitution.
Can't find CID font "Arial".
Attempting to substitute CID font /Adobe-Identity for /Arial, see doc/Use.htm#CIDFontSubstitution.
Can't find CID font "Arial".
Attempting to substitute CID font /Adobe-Identity for /Arial, see doc/Use.htm#CIDFontSubstitution.
Page 2
Can't find CID font "Arial".
Attempting to substitute CID font /Adobe-Identity for /Arial, see doc/Use.htm#CIDFontSubstitution.
Loading a TT font from %rom%Resource/CIDFSubst/DroidSansFallback.ttf to emulate a CID font Adobe-Identity ... Done.
Can't find CID font "Verdana".
Attempting to substitute CID font /Adobe-Identity for /Verdana, see doc/Use.htm#CIDFontSubstitution.

是否有任何參數可以解決我對這些字體的問題? 謝謝你。

PS:如果你想測試原始的PDF文件,你可以在這里下載: PDF文件

您的 PDF 文件使用以下 CIDFonts; Arial、Arial、Bold、Verdana、Verdana、Bold 和 Verdana、BoldItalic。 它不包括任何這些字體。

雖然不包含常規字體是不好的做法,但規范中明確規定必須嵌入 CIDFonts。 然而,許多創作者未能做到這一點,大概是因為它比較難。 更容易包含參考,並將繁重的工作留給 PDF 用戶。 那么,如果消費者無法使用該字體怎么辦......

如果字體或 CIDFont 不存在 Ghostscript 必須使用替代品。 CIDFont 比常規字體更難替代,Ghostscript 基本上附帶了一個真正的替代 CIDFont,DroidSansFallback,它用於所有語言。 有一個“子彈”CIDFont,它是最后的后備方案,因為它只包含一個子彈字形。

要獲得正確的輸出,您必須將 CIDFont 嵌入 PDF 文件中,或者提供合適的替代 CIDFont 供 Ghostscript 使用。 請注意, FONTPATH開關僅適用於字體,而不適用於 CIDFonts,因此它對這個文件沒有用處(盡管它可能對使用字體的文件有好處,顯然)。

Ghostscript 文檔中描述了 CIDFont 替換機制。 我想,如果您向 Ghostscript 提供各種 Windows TrueType 字體作為缺少的命名 CIDFonts 的替代品,那么您的文件將正確呈現。

請注意,由於您使用的是 Windows,Ghostscript 將使用 ROM 文件系統。 如果您編輯 cidfmap 文件,您將需要使用-I (包含)開關將包含 cidfmap 文件的路徑添加到搜索路徑。 您可能會發現簡單地編輯 c:\Program Files (x86)\gs\gs9.27\Resource\Init 中的文件並使用-I"c:/Program Files (x86)/gs/gs9.27/Resource/Init"添加該輸入路徑會更容易-I"c:/Program Files (x86)/gs/gs9.27/Resource/Init"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM