2006-05-25 (木)
■ a2ps と ps2pdf と a2pdf
PHP のソースコードを印刷しようと思い、 久しぶりに a2ps を使ってみることにした。 a2ps をインストールしてあるマシンが無かったので、 VMware 上の Vine Linux に a2ps を apt-get でインストール。 ただし、プリンタが接続できていないので、 さらに ps2pdf で PDF ファイルに変換して、 プリンタのつながっている Windows マシンから印刷しようとした。
ところが、出来上がった PDF ファイルをプレビューしてみると、 右端が切れてしまっている。 その原因を調べるのにまた時間を費やしてしまったが、 結局、犯人は ps2pdf だった。 日本発のディストリビューションなのに、 ps2pdf のデフォルトの用紙設定が、 A4 でなく Letter サイズになっていた…。
さて、どう対処しよう? 設定をいちいち手入力するのも面倒だから、 シェルスクリプトを書いて一気に変換するか。
#!/bin/sh for file in $*; do a2ps $file | ps2pdf -sPAPERSIZE=a4 - > $file.pdf done
これでよし。 なんて名前で保存しようか? 機能から言って a2pdf かな? そう考えたところで、嫌な予感がして、 以下のコマンドを実行してみた。
[revulo@vine revulo]$ which a2pdf /usr/bin/a2pdf [revulo@vine revulo]$
…あるじゃん。 しかも、中身を見てみると、 上のシェルスクリプトと同じようなことをやっている。 最初からこれを使えばよかったのか orz
…と思ったが、 /usr/bin/a2pdf は複数のファイルを一度に処理できなかったので、 結局、上記のシェルスクリプトが役立った。
[コメントを書く]
本日のリンク元
- 8 google検索(a2pdf)
- 7 google検索(a2pdf)
- 5 google検索(a2pdf)
- 5 http://blogsearch.plaza.rakuten.co.jp/search?fm=bl...
- 4 google検索(a2pdf)
- 3 google検索(a2ps ps2pdf)
- 3 google検索(a2pdf)
- 3 google検索(Linux a2ps)
- 3 http://www.google.co.jp/hws/search?hl=ja&q=a2pdf&c...
- 3 http://72.14.235.104/search?q=cache:LznFFXdm_XcJ:w...
- 3 http://209.85.175.104/search?q=cache:LznFFXdm_XcJ:...
- 2 google検索(a2ps ps2pdf)
- 2 google検索(a2pdf)
- 2 google検索(CentOS a2ps インストール)
- 2 google検索(a2ps pdf)
- 2 google検索(a2ps linux)
- 2 google検索(centos ps2pdf)
- 2 google検索(a2ps a2pdf)
- 2 google検索(a2ps 5.)
- 2 google検索(a2pdf vine)
- 2 google検索(a2pdf)
- 2 google検索(a2pdf)
- 2 google検索(a2pdf)
- 2 google検索(a2ps ソースを印刷 一気に)
- 2 google検索(a2ps 右端)
- 2 google検索(ps2pdf a4)
- 2 google検索(centos ps2pdf)
- 2 google検索(centos a2pdf)
- 2 google検索(a2ps ps2pdf)
- 2 google検索(a2pdf)
- 2 google検索(a2pdf)
- 2 google検索(LINUX a2pdf)
- 2 google検索(ps2pdf 日本語)
- 2 google検索(A2PS PS2PDF)
- 2 http://www.google.co.jp/hws/search?q=ps2pdf&client...
- 2 http://translate.google.com/translate?hl=en&sl=ja&...
- 2 http://search.nifty.com/cgi-bin/search.cgi?select=...
- 2 http://72.14.235.104/search?q=cache:LznFFXdm_XcJ:w...
- 2 http://72.14.235.104/search?q=cache:LznFFXdm_XcJ:w...
- 2 http://209.85.175.104/search?q=cache:LznFFXdm_XcJ:...
- 2 http://209.85.175.104/search?q=cache:LznFFXdm_XcJ:...
- 2 http://209.85.175.104/search?q=cache:LznFFXdm_XcJ:...
- 1 google検索(vine a2ps)
- 1 google検索(t)
- 1 google検索(a2pdf)
- 1 google検索(ps2pdf A4サイズ)
- 1 google検索(linux コマンド a2pdf)
- 1 google検索(a2ps windows)
- 1 google検索(a2ps ps2pdf)
- 1 google検索(a2ps centos)
- 1 google検索(a2ps a4 letter)
- 1 google検索(a2ps 文字化け)
- 1 google検索(a2ps linux)
- 1 google検索(a2pdf --title)
- 1 google検索(a2pdf)
- 1 google検索(Debian etch ps2pdf)
- 1 google検索(Debian Etch a2ps)
- 1 google検索(正規表現 ps2pdf)
- 1 google検索(ps2pdf 設定)
- 1 google検索(ps2pdf windows)
- 1 google検索(ps2pdf a2ps)
- 1 google検索(ps2pdf 右端に)
- 1 google検索(a2ps ps2pdf 切れ)
- 1 google検索(CentOS a2ps pdf)
- 1 google検索( ps2pdf a2pdf |)
- 1 google検索(apt a2pdf)
- 1 google検索(ps2pdf LINUX)
- 1 google検索(a2ps centos)
- 1 google検索(ps2pdf CentOS パッケージ)
- 1 google検索(ps2pdf Linux)
- 1 google検索(a2ps 調べる)
- 1 google検索(a2pdf a2ps)
- 1 google検索(a2pdf a2ps)
- 1 google検索(a2pdf)
- 1 google検索(ps2pdf)
- 1 google検索(a2ps ps2pdf)
- 1 google検索(CentOS PDF 変換)
- 1 google検索(ps2pdf letter size)
- 1 google検索(a2ps PDF)
- 1 google検索(vinelinux a2ps)
- 1 google検索(a2ps pdf)
- 1 google検索(ps2pdf a4)
- 1 google検索(linux a2pdf)
- 1 google検索(a2ps linux)
- 1 google検索(a2ps ps2pdf)
- 1 google検索(a2ps ps2pdf)
- 1 google検索(a2pdf)
- 1 google検索(ps2pdf letter)
- 1 google検索(ps2pdf letter a4)
- 1 google検索(a2ps ps2pdf)
- 1 google検索(a2ps 複数のファイル)
- 1 google検索(ps2pdf a2ps)
- 1 google検索(rfc a2ps 印刷)
- 1 google検索(ps2pdf a4)
- 1 google検索(ps2pdf 複数のファイル)
- 1 google検索(etch ps2pdf)
- 1 google検索(a2ps pdf)
- 1 google検索(a2pdf A4)
- 1 google検索(a2pdf)
- 1 google検索(a2pdf)
