Writing doc output to pdf

巧了我就是萌 提交于 2019-12-23 04:57:21

问题


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:


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.



来源:https://stackoverflow.com/questions/30766236/writing-doc-output-to-pdf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!