Postscript または pcl ファイルから文書ページ情報を判別する必要があります。Java が望ましいですが、Ghostscript/Ghostpcl も同様に優れています。
次の情報を取得しようとしたこと:
ページの色
This can be achieved with ghostscript/ghostpcl using the device called inkcov.
PostScript
gswin64c.exe -dNOPAUSE -dBATCH -sDEVICE=inkcov -o- input.ps
PCL6
gpcl6win64 -dNOPAUSE -dBATCH -sDEVICE=inkcov -o- input.pcl
ページサイズ
There is a device called bbox which gives me the boundary box per page for PostScript or PCL6 documents
PostScript
gswin64c.exe -dNOPAUSE -dBATCH -sDEVICE=bbox -o- input.ps
PCL6
gpcl6win64 -dNOPAUSE -dBATCH -sDEVICE=bbox -o- input.pcl
しかし、結局のところ、境界ボックスはページ サイズの不正確な概算です。次の投稿を確認しましたが、私のゴーストスクリプト バージョン 9.5 では解決策が機能しないようです PostScript ドキュメントのページ サイズを取得する