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

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
revan
Posts: 1
Joined: Tue Feb 21, 2023 3:28 pm

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

Post 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 ...
Last edited by MrProgrammer on Wed Feb 28, 2024 7:08 pm, edited 2 times in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Apache OpenOffice 4.1.13
Manjaro Linux
User avatar
MrProgrammer
Moderator
Posts: 4909
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Convert RTF to PDF via command line

Post 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
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Convert RTF to PDF via command line

Post 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.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Post Reply