Take the 2-minute tour ×

I have a program that generates console output colored with ANSI codes. How to convert it to PDF keeping the colors?

I need a unixish command line solution

share|improve this question
Found something close to what I need here: stackoverflow.com/questions/245121/… and then print HTML as it is described in stackoverflow.com/questions/176476/… –  grep Feb 15 '13 at 22:14
add comment

2 Answers

If you have calibre/pdfcreator/cutepdf kind of utility installed in your environment or computer. You can use lp to send text to printer.

share|improve this answer
Thank you, but they all are GUI stuff, and pdfcreator is Windows only. Don't fit. –  grep Feb 15 '13 at 22:04
add comment

The best solution so far: aha to convert to HTML (http://stackoverflow.com/questions/245121/a-library-to-convert-ansi-escapes-terminal-formatting-color-codes-to-html), then convert HTML to PDF e.g. with wkhtmltopdf.

I am still looking for a one step solution.

share|improve this answer
add comment

Your Answer


