filter ; フィルター作成

前へ| 次へ

pipslitemyfilter01

場所はどこでも良いでしょう 此処にしました、 ファイルの名前と内容は こ の様なものです。

# pwd
/usr/local/bin
# ls -l pipslitemyfilter01 
-rwxr-xr-x    1 daemon   daemon         93 Nov 23 21:34 pipslitemyfilter01*
# cat pipslitemyfilter01
#! /bin/bash
/usr/bin/gs -q -sOutputFile=- -sDEVICE=png16m -r360 - | /usr/bin/pipslite  -ui C

/etc/printcap

”/etc/printcap”の 内容は 以下のものを 追加しました

####### test of pipslitemyfilter01

epson|ps|PM-A890:\
    :sd=/var/spool/lpd/lite:\
    :mx#0:\
    :sh:\
    :lp=/var/run/ekplp0:\
    :if=/usr/local/bin/pipslitemyfilter01:

念の為 再起動してから

印刷試験 ps ファイル

試してみます

$ lpq
no entries
$ lpr -P PM-A890 samplelandscape.ps &
$ lpq
Warning: no daemon present
Rank   Owner      Job  Files                                 Total Size
1st    fdopstm    38   samplelandscape.ps                    4800309 bytes
[1]+  Done                    lpr -P PM-A890 samplelandscape.ps
$ lpc
lpc> status
lite:
        queuing is enabled
        printing is enabled
        1 entry in spool area
        PM-A890 is ready and printing
epson:
        queuing is enabled
        printing is enabled
        1 entry in spool area
        PM-A890 is ready and printing
/*  Ctrl + d  */
$ lpq
no entries

印刷完了です。

印刷試験 pdf ファイル

$ ps2pdf samplelandscape.ps
*** unembeddable CIDFont: /Kochi-Mincho
*** unembeddable CIDFont: /Ryumin-Light
$ ls -l samplelandscape.ps samplelandscape.pdf
-rw-r--r--    1 fdopstm  users     2173118 11月 24日  15:10 samplelandscape.pdf
-rw-r--r--    1 fdopstm  users     4800309 11月 19日  11:43 samplelandscape.ps
$ lpr -P PM-A890 samplelandscape.pdf &
[1] 626
$ lpq
Warning: no daemon present
Rank   Owner      Job  Files                                 Total Size
1st    fdopstm    40   samplelandscape.pdf                   2173118 bytes
[1]+  Done                    lpr -P PM-A890 samplelandscape.pdf
$ lpc
lpc> status
lite:
        queuing is enabled
        printing is enabled
        1 entry in spool area
        PM-A890 is ready and printing
epson:
        queuing is enabled
        printing is enabled
        1 entry in spool area
        PM-A890 is ready and printing
lpc> 
/*  Ctrl + d  */

の場合は おおよそ 半分しか印刷できない pdf ファイルにすると 縦置きになるようです。そこで gimp を 立ち上げて pdf ファイルを開き 用紙の設定を 横長に すると 印刷は可能だが ps ファイルの 印刷に 比較して汚いものが 出てきま す。

これに関した ものを gimp にて 見ると ど のように印刷されるかが 理解できるかも しれません。

現状の 確認

印刷するに ps ファイルを印刷するには

$ lpr -P PM-A890 samplelandscape.ps

で 印刷する

pdf ファイルを 印刷するには 用紙の 横方向の 指定が出来ないので gimp を一度 立ち上げて 用紙の 横方向の 設定が出来るので これで印刷する事は 可 能 但し 品質は 理由は わからないが 落ちる

というので ps ファイルを gimp で一度 読み込み その後で 印刷すると こ の場合は 用紙を 縦に設定して 印刷するのですが これも lpr で 印刷するより 品質は 落ちる。

gimp の 環境設定 は デフォルトの 画像解像度と 単位 は 360 dpi に して あるのですが 標準は 72 dpi で有るのですが

環境設定 を 72 dpi に しても 同じく 品質は悪い ということは ps から pdf に 変換した場合も 有る程度の 劣化が 発生しているのだろうか しかし gimp 印刷で ps ファイルを 印刷しても 劣化が 発生しているので、やはり gimp が 原因?? という状態です。

誤解の 無いように 其々の ソフト (アプリケーション プログラム という のか)の チューニングを 最適に している理由ではありません。従って 何が 悪さをしているのかは 不明です。 現状では ”lpr ”という 方法が もっぱら 奇麗 と言うだけです ここで pipslite と 比較するには png ファイルに 変換 しないと いけません。 すなわち ”lpr”の 場合には -r360 という 項目が 有りました

/usr/bin/gs -q -sOutputFile=- -sDEVICE=png16m -r360 - | /usr/bin/pipslite  -ui C

ps から png にする場合は 例えば

$ cat samplelandscape.ps |\
 gs -r360 -g2976x4209 -sDEVICE=png16m -q -dNOPROMPT -dNOPAUSE \
-dSAFER -sOutputFile=- - -c quit >samplelandscape.png

の 様な 方法に なると 考えられます この 中で -r360 という項目が有る ので これを 比較するには 何をしているのだ ということですので 比較するの は 有る意味で 何をしてるんだ ということですが。

$ cat samplelandscape.ps |\
> gs -r360 -g2976x4209 -sDEVICE=png16m -q -dNOPROMPT -dNOPAUSE \
> -dSAFER -sOutputFile=- - -c quit >samplelandscape.png
$ ls -l samplelandscape.png 
-rw-r--r--    1 fdopstm  users      803481 11月 24日  22:36 samplelandscape.png

やってなんぼ です これは pipslite を 立ち上げて 印刷するのですが”lpr” と 同等と考えられます。 これは 個猫 以外の 目を 借りてみた結果です。 何 億の 2個 にしか過ぎないのですが 1個 よりは 評価は 公平でしょう??

印刷に かかる時間を 考慮しないのであれば dvi から ps にして 印刷” lpr”というのが もっとも 一貫性が有るようです(目的はそのために 試みてい るのですが) 但し、時間を考慮すると また別の 方法が有るやしれません。

     4800309  samplelandscape.ps
     2173118  samplelandscape.pdf
      803481  samplelandscape.png

ファイルの 大きさを 考えると 有る程度 想定出来そうですが ps は かなり 大きいということです。

にゃんたろう 拝!

2008年11月24日 (月) 21:06:30 JST 作成


前へ| 次へ

filter ; フィルター作成

Copyright © 2006.-2008. nyantarou All Rights Reserved.