5

私は PDF を PCL に変換しようとしています (ghostscript を使用していますが、別の提案を聞きたいです)、すべての組み込みおよびgutenprint を含むすべてのドライバー (ghostscript デバイス) は、入力よりも何倍も大きな PCL ファイルを生成しますPDF. (これが問題です - PCL を入力と同じくらい小さくする必要があります)。

テキストが PCL ファイルに表示されないことを考えると、Ghostscript がテキストをラスタライズしていると思います。GS 全般、または単にgutenprintがそれを行うのを防ぐ方法はありますか? フォントを埋め込むか、フォントを埋め込まない(フォントをレンダリングするためにプリンターに任せる)ほうがいいですか?

残念ながら、この点に関するドキュメントはないようです。

4

2 に答える 2

5

There are 3 (I think) types of font in PCL. There are rendered bitmaps, TrueType fonts (in later versions) and the HPGL stick font.

PDF and PostScript Have type 1, 2 (CFF), 3 and 42 (TrueType, but not the same as PCL) and CIDFonts based on any of the preceding types.

The only font type the two have in common is TrueType, so in order to retain text, any font which was not TrueType would have top be converted into TrueType. This is not a simple task. So Ghostscript simply renders the text, which is guaranteed to work.

PDF is, in general, a much richer format than PCL< there are many PDF constructs (fonts, shading, stroke/fill in a single operation, transparency) which cannot be represented in PCL. So its entirely possible that the increase in size is nothing to do with text and fonts.

In fact, I believe that the PXL drivers in Ghostscript simply render the entire page to a bitmap at the required resolution, and then wrap that up with enough PCL to be successfully sent to a printer. (I could be mistaken on this point though)

Basically, you are not going to get PCL of a similar size to your PDF out of Ghostscript.

于 2012-05-27T12:07:42.633 に答える
3

これは、「Ghostscript がテキストをラスタライズするのを防ぐ」方法です。ただし、その出力は PostScript になります。ただし、追加の手順でこの PostScript を PCL5e に変換できます。

このメソッドは、すべてのグリフをPostScript出力用のアウトライン形状に変換しますが、PDF または PCL 出力では機能しません。ここで重要なのは -dNOCACHE パラメータです。

gs -o somepdf.ps -dNOCACHE -sDEVICE=pswrite somepdf.pdf

もちろん、フォントグリフをアウトラインに変換すると、元のフォントを埋め込んだままにしておくよりも多くのスペースが必要になります。これは、「フォント」がグリフ形状を保存、取得、およびレンダリングするためのスペース最適化された概念であるためです。

この PostScript を取得したら、以前に試した PDF 入力のいずれかの方法 ({Apache?} FOP を含む) を使用して、PCL5e に変換できる場合があります。

ただし、出力がラスタライズされたフォント (または健全なラスタライズされたページ) を使用したバージョンよりもはるかに小さくなるかどうかはわかりません。しかし、それはテストする価値があるかもしれません。

今、この回答も投票してください...


アップデート

どうやら、バージョン 9.15 (2014 年 9 月または 10 月にリリース予定) から、Ghostscript は新しいコマンド ライン パラメーターをサポートするようになります。

 -dNoOutputFonts

これにより、出力デバイスが発生し、pdfwrite(出力にフォントを書き込むのではなく) グリフを「基本的な」マーキング操作に「フラット化」する」ようになりps2writeます。eps2write

つまり、上記のコマンドを次のように置き換える必要があります。

 gs -o somepdf.ps -dNoOutputFonts -sDEVICE=ps2write somepdf.pdf

警告:現在の Git ソースに基づいて自己コンパイルした Ghostscript を使用して、いくつかの入力ファイルでこれをテストしました。いずれの場合も問題なく動作しました。

于 2012-05-27T15:45:02.640 に答える