enscript

Convert text files to PostScript, HTML, or RTF with syntax highlighting

brewmacoslinux
Try with needOr install directly
Source

About

Convert text to Postscript, HTML, or RTF, with syntax highlighting

Commands

enscript

Examples

Convert a text file to PostScript$ enscript -B -p output.ps input.txt
Convert source code to HTML with syntax highlighting$ enscript -B -h -p output.html script.py
Convert text to PostScript with line numbers and 2 columns$ enscript -n -2 -p output.ps file.txt