Linux:命令行实用程序将RTF转换为PDF?

问题描述 投票:8回答:5

是否有将RTF转换为PDF的建议?我需要从我的LAMP应用程序中执行此操作,因此,像GhostScript这样的命令行实用程序将是理想的选择。

pdf rtf ghostscript
5个回答
3
投票
sudo apt-get install ted

/usr/share/ted/Ted/rtf2pdf.sh source-file dest-file

或访问此link


10
投票

或者,您可以使用libreoffice来完成此任务:

libreoffice --headless --invisible --norestore --convert-to pdf source-file.rtf

2
投票

在我的Ubuntu 10.4中,我有unrtf,它“将RTF转换为HTML,LaTeX,Postscript”。在Postscript中,它应该是ps2pdf的简单应用,以获取PDF。


0
投票

在Cent OS 6下,这些步骤对我来说可以将php文件中的RTF转换为PDF:

  1. yum install Ted
  2. yum install ghostscript
  3. 将rtf2pdf.sh下载到/ var / www / html / lib这样的路径,其中Apache具有足够的权限
  4. shell_exec('sh /lib/rtf2pdf.sh /files/test.rtf /files/test.pdf');

0
投票

unoconv非常方便地执行此操作。 (仅供参考,我当前使用的是0.5-1版本)。我必须先运行unoconv --listener &命令,然后再运行unoconv *.rtf命令,例如...

© www.soinside.com 2019 - 2024. All rights reserved.