将文档输出写入 pdf

Writing doc output to pdf

各位R爱好者大家好,

我想知道我们是否可以在 R 中从 docx 创建一个 pdf 版本(不使用其他转换工具)。我使用 ReporteRs 包创建了一个 docx 报告。我想制作一份 pdf 副本。是否可以在 R 中不使用任何外部软件?提前谢谢你。

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

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

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