How to convert ęąśćżńł TXT to PDF with enscript

conversionenscriptpdftext;unicode

I have problem converting a file to PDF. I create the file with

echo ęąśćżńł > text

and convert:

enscript -O text -o - | ps2pdf - out.pdf

However, out.pdf has an encoding problem:

screenshot of corrupted pdf file

Best Answer

enscript just does not support Unicode. You need to use a different tool such as paps to convert text to PostScript. With --header option an output .pdf is similar to one produced with enscript:

$ paps text --header | ps2pdf - outheader.pdf
Related Question