将文档输出写入 pdf [英] Writing doc output to pdf

查看:37
本文介绍了将文档输出写入 pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位 R 爱好者,

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

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.

推荐答案

这是一种方法.免责声明:此答案来自 ReporteRs 的 google 组.

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)

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

It needs libreoffice application to be installed in your system.

这篇关于将文档输出写入 pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆