将doc输出写入pdf

时间:2015-06-10 20:04:17

标签: r report reporters

你好R爱好者,

我想知道我们是否可以在R中使用docx创建pdf版本(不使用其他转换工具)。我使用ReporteRs包创建了一份docx报告。我想在pdf副本中复制一份。在没有使用任何外部软件的情况下,它是否可以在R中?提前谢谢。

1 个答案:

答案 0 :(得分:1)

这是一种方法。免责声明:此答案出现在ReporteRs的Google群组中。

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

它需要在您的系统中安装libreoffice应用程序。