在Linux中将文本转换为pdf的简便解决方案 [英] a light solution to convert text to pdf in Linux
本文介绍了在Linux中将文本转换为pdf的简便解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在Linux中寻找一种简便的解决方案,以从字面上看将*.txt
文件转换为pdf
格式.我希望该解决方案能够满足要求:
I am looking for a light solution in linux, to literally convert a *.txt
file into pdf
format. I hope the solution satisfies:
- 轻巧.我知道将
*.txt
重命名为*.odt
然后使用libreoffice
是一种途径,但是它将加载繁重的libreoffice
. - 我知道
pr|groff -Tpdf
是一种解决方案,但实际上并不起作用:它会丢弃我的换行符,可能会误食一些特殊标记作为转义标签,从而导致潜在的错误.但是我仍然希望尽可能多地使用这些旧工具,因为它们既稳定又快速.
- 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.
非常感谢!
推荐答案
一种方法是使用 ps2pdf
>
enscript -p file.ps file.txt
ps2pdf file.ps file.pdf
这篇关于在Linux中将文本转换为pdf的简便解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文