Any recommendations to convert an RTF to a PDF? I need to do this from my LAMP application, so a command line utility like GhostScript would be ideal.
sudo apt-get install ted
/usr/share/ted/Ted/rtf2pdf.sh source-file dest-file
or visit this link
ted
, is there a website or so? It doesn't seem to be part of Ubuntu. Also, did you just search and paste ;-) –
Notice Alternatively, you can use libreoffice for this task:
libreoffice --headless --invisible --norestore --convert-to pdf source-file.rtf
javaldx: Could not find a Java Runtime Environment!
Warning: failed to read path from javaldx
–
Polite sudo apt-get install ted
/usr/share/ted/Ted/rtf2pdf.sh source-file dest-file
or visit this link
ted
, is there a website or so? It doesn't seem to be part of Ubuntu. Also, did you just search and paste ;-) –
Notice In my Ubuntu 10.4 I have unrtf
, which "converts RTF to HTML, LaTeX, Postscript". From Postscript it should be a trivial application of ps2pdf
to get PDFs.
unoconv
does this very conveniently. (FYI, I'm currently using version 0.5-1 of same). I have to first run a unoconv --listener &
command, followed by a unoconv *.rtf
command, for example...
UPDATE: I can verify that, on my Debian Jessie machine, version 0.6 of unoconv behaves in the above fashion. However, the unoconv --listener &
command is now no longer necessary (indeed, same seems to cause difficulties if later attempting to open a LibreOffice file...).
Under Cent OS 6, these steps worked for me to convert RTF to PDF from a php file:
- yum install Ted
- yum install ghostscript
- Download rtf2pdf.sh to some path like: /var/www/html/lib, where Apache has sufficient permissions
- shell_exec('sh /lib/rtf2pdf.sh /files/test.rtf /files/test.pdf');
© 2022 - 2024 — McMap. All rights reserved.