0

Ghostscript を使用して pdf ドキュメントを pcl ドキュメントに変換しようとすると問題が発生します。

元の pdf 文書は横向きなので、pcl も同様である必要があります。それにもかかわらず、次のコマンド関数で Ghostscript 9.14 を使用する Windows では:

gswin32 -dNOPAUSE -dBATCH -sDEVICE=ljet4 -dSAFER -dAutoRotatePages=/NONE -sPAPERSIZE=a4 -sOutputFile=./convert_windows.pcl ./duplicate_windows.pdf

Ubuntu Linux Kernel Version 3.2.0-40-generic 64 bit で同じコマンドを実行すると、Ghostscript 9.05 を使用すると、オリジナルの A4 ではなくサイズ A3 の間違った向きの pcl ファイルが生成されます。

元の pdf ファイルには Windows フォント「arial」が含まれており、Linux でも利用できるはずです。Linux にはパッケージ「msttorcefonts」がインストールされています。これは、Ghostscript のフォントマップの短い抜粋です。

cat /usr/share/ghostscript/9.05/Resource/Init/Fontmap.GS

与えます:

% This font, and only this font among the Hershey fonts, uses
% the SymbolEncoding.

/Hershey-Symbol                         (hrsyr.gsf)     ;       % 5066567

/Arial                                  /ArialMT                ;
/Arial,Bold                             /Arial-BoldMT           ;
/Arial,Italic                           /Arial-ItalicMT         ;
/Arial,BoldItalic                       /Arial-BoldItalicMT     ;

次のリストは、Linux コマンド ラインの出力を示しています。これは、Windows の Ghostscript コンソールからの出力と同じです。

GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 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
Loading NimbusMonL-Bold font from /usr/share/fonts/type1/gsfonts/n022004l.pfb... 3627296 2211468 1767360 473754 3 done.
Loading NimbusSanL-Bold font from /usr/share/fonts/type1/gsfonts/n019004l.pfb... 3668288 2319461 1807728 497748 3 done.
Loading NimbusSanL-Regu font from /usr/share/fonts/type1/gsfonts/n019003l.pfb... 3800176 2466391 1827912 512832 3 done.
Loading NimbusMonL-Regu font from /usr/share/fonts/type1/gsfonts/n022003l.pfb... 3964224 2617715 1969200 654805 3 done.
Page 2

私はすでにGhostscriptのいくつかのオプションを試しました

-dFIXEDMEDIA
-dNORAGEPAGESIZE

その他。

PDF ドキュメントを ps に変換すると、結果は両方の環境で同じになります。

誰かがその問題やアイデアの経験がありますか?

よろしくお願いいたします。

4

2 に答える 2

0

これは可能な解決策である可能性があり、私の場合はうまくいきます。前提条件: Ghostscript バージョン 8.6.0 以降!

gs コマンドではなく、ghostscript パッケージの一部であるgs ラッパーpdf2psを使用して pdf を ps に変換します。

pdf2ps input.pdf output.ps

BUT:横長の PDF ドキュメントの場合、これはバージョン 8.60 以降でのみ機能します。そうしないと、横向きのドキュメントが縦向きに印刷されます。

次のコマンドを使用して、pdfをpclに変換することができました:

gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=ljet4 -sPAPERSIZE=a4 -sOutputFile=output.pcl -c "<< /InputAttributes << currentpagedevice /InputAttributes get { pop null } forall >> dup 0 << /PageSize [ 595 842 ] >> put >> setpagedevice" save pop -f input.pdf

ただし:このコマンドは、ghostscript の Bug Bug 689919 のドキュメント ( http://bugs.ghostscript.com/show_bug.cgi?id=689919を参照) に基づいており、バージョンをインストールした場合にのみ、縦方向のドキュメントに対してのみ機能します。 8.60 以上。承認できる環境が 3 つあるため、このコマンドはバージョン 8.60 以降で機能します。バージョン 8.16、8.62、および 9.05 を使用しました。

Ghostscript のバージョン 8.62 と 9.05 では、どちらのコマンドも pdf --> ps と pdf --> pcl の横向きと縦向きで正しく機能しました。

于 2014-06-03T18:16:20.420 に答える