a2ps is a nice tool to convert anything text-like to postscript, but lacks the capability of detecting umlauts and special utf-8 characters. Beside that, generating a pdf is often more useful than a postscript file.
That's why I wrote two simple scripts to enhance the a2ps command. The trick is to use recode, a2ps, ps2pdf together:
INPUTFILE=test.txt TMPFILE=/tmp/A2pdf_${INPUTFILE} cp $INPUTFILE $TMPFILE recode -f UTF-8..Latin-1 $TMPFILE a2ps $TMPFILE -o $TMPFILE.ps -1 -X ISO-8859-1 --center-title=$INPUTFILE ps2pdf -sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite $TMPFILE.ps $OUTPUT rm $TMPFILE rm $TMPFILE.ps
This script also creates an a4 sheet with only a single text content window. Command-line call:
A file yourFile.txt.pdf is created in the same directory.
file | file size | comments |
---|---|---|
A2pdf.sh | 545 B | featured by this article |
A2ps.sh | 445 B | featured by this article |
XEmacs_quickref.pdf | 80 KB | none |
auctex-ref.pdf | 96.25 KB | none |
createIEEEPDF.sh | 622 B | none |
createWinVid.sh | 800 B | none |
ctags.zip | 241 B | none |
vpnclient-linux-2.6.19+-rev1.diff | 3.54 KB | none |