Convert docx to pdf
Convert docx to pdf directly using "Microsoft Word". This function will not work if "Microsoft Word" is not available on your machine.
On Windows, this is implemented via win32com while on macOS this is implemented via JXA (Javascript for Automation, aka AppleScript in JS).
This is a simple call to python module 'docx2pdf'.
docx2pdf(input, output = gsub("\\.docx$", ".pdf", input))
input, output |
file input and optional file output (default to input with pdf extension). |
the name of the produced pdf (the same value as output
)
Other tools for docx2pdf:
docx2pdf_available()
,
docx2pdf_install()
,
docx2pdf_uninstall()
library(locatexec) if (exec_available('python') && docx2pdf_available()) { file <- system.file(package = "doconv", "doc-examples/example.docx") out <- docx2pdf(input = file, output = tempfile(fileext = ".pdf")) if (file.exists(out)) { message(basename(out), " is existing now.") } }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.