Page 1 of 1

[Solved] Convert RTF from R to PDF via command line

Posted: Tue Feb 21, 2023 3:38 pm
by revan
Hello,

I am creating tables with R and save the output as RTF files. Is there a server-mode/CLI/headless to convert RTF files to PDF with OpenOffice?

Note: I also considered using libreoffice, however reading my RTF files with Libreoffice has several issues (wrong font, mismatches in the table), and therefore I would rather like to use OpenOffice (where the output looks correct). As I have to do this for many files once a day, I am looking for a solution that I can automate on a Linux server.

Thank you for your help!

PS: Hope I added this to the correct forum ...

Re: Convert RTF to PDF via command line

Posted: Tue Feb 21, 2023 6:05 pm
by MrProgrammer
revan wrote: Tue Feb 21, 2023 3:38 pm I am creating tables with R and save the output as RTF files.
Your problem disappears if you can avoid RTF from R and create the PDF directly:
Export all the content of R script into PDF
Cookbook for R » Graphs » Output to a file
14.1 Outputting to PDF Vector Files
How to Save Multiple Plots to PDF in R
Export R output to a file

revan wrote: Tue Feb 21, 2023 3:38 pm Is there a server-mode/CLI/headless to convert RTF files to PDF with OpenOffice?
Earlier discussion in our forum:
Silently convert RTF to PDF
QR code conversion failure from RTF to PDF
Converting .rtf file to .pdf fails
RTF to PDF conversion fails
RTF to PDF with OO in server mode
Convert rtf to pdf

Re: Convert RTF to PDF via command line

Posted: Tue Feb 21, 2023 7:18 pm
by John_Ha
revan wrote: Tue Feb 21, 2023 3:38 pm I am creating tables with R and save the output as RTF files.
.rtf files are pretty rubbish - see [Tutorial] Differences between Microsoft and AOO/LO files for a discussion. Save as .odt is best.