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.
On a Windows 10 machine, open the file you want to convert. Press the Control and P keys to open the system's print dialogue box. In the box, under Printer, select Microsoft Print to PDF and click the Print button to save a copy of the R.T.F. file as a PDF to your computer.
Once all prerequisites are installed, follow these two steps to generate a PDF file from a text file. First, convert a text file to Postscript format by using enscript command-line tool. Finally convert the generated postscript file to a PDF file.
Alternatively, click the File menu and select Export as, and then Export as PDF. The second method gives you a lot of options for your PDF file creation. Click the Export button, and name the file if you haven't already done so. Now your file will be exported as a PDF file.
Alternatively, you can use libreoffice for this task:
libreoffice --headless --invisible --norestore --convert-to pdf source-file.rtf
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...).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With