I am looking for a light solution in linux, to literally convert a *.txt
file into pdf
format. I hope the solution satisfies:
- lightweight. I know renaming
*.txt
to*.odt
and then uselibreoffice
is a pathway, but it will load the heavylibreoffice
. - I know
pr|groff -Tpdf
is a solution, yet it does not work literally: it throws away my line-breaks, an may accidentally eat some special marks as escaped labels, making potential bugs. But I still hope to use these old tools as much as possible, because they are stable and fast.
Many thanks!
Advertisement
Answer
One way would be to use enscript
followed by ps2pdf
enscript -p file.ps file.txt ps2pdf file.ps file.pdf