6

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

  • What kind of encoding problem is it that out.pdf has? – Erathiel Apr 21 '15 at 13:53
  • I'd have thought iconv -t latin2 < text | enscript -X latin2 -o - would work, but apparently not. Anybody knows why? – Stéphane Chazelas Apr 21 '15 at 14:34
  • 1
    Replying to myself. It's in this FAQ. Probably not worth bothering with enscript and use paps or a2ps or other. – Stéphane Chazelas Apr 21 '15 at 14:40
  • Paps not support headers and footers created with User. – Miko Apr 22 '15 at 10:35
4

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
  • Paps not support headers and footers created with User. – Miko Apr 22 '15 at 12:32
  • What is User? – Arkadiusz Drabczyk Apr 22 '15 at 12:34
  • I'm a user and I would like created header and footer – Miko Apr 22 '15 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.