Writing doc output to pdf

2.4k views Asked by At

Hello fellow R enthusiasts,

I am wondering whether we can create a pdf version from docx within R (not using other conversion tools). I create a docx report using ReporteRs package. I would like to make a copy of that in pdf copy. Is it possible within R, without using any external softwares? Thank you in advance.

1

There are 1 answers

0
JeanVuda On BEST ANSWER

Here is one way to do it. Disclaimer: This answer came up in google group of ReporteRs.

writeDoc( doc, file = docfile)
system(paste("libreoffice --headless --convert-to pdf  ", docfile), intern = TRUE)

It needs libreoffice application to be installed in your system.