Convert pptx to pdf directly using "Microsoft PowerPoint". This function will not work if "Microsoft PowerPoint" is not available on your machine.
The calls to "Microsoft PowerPoint" are made differently depending on the operating system. On "Windows", a "PowerShell" script using COM technology is used to control "Microsoft PowerPoint". On macOS, an "AppleScript" script is used to control "Microsoft PowerPoint".
pptx2pdf(input, output = gsub("\\.pptx$", ".pdf", input))
the name of the produced pdf (the same value as output
)
library(locatexec)
if (exec_available('powerpoint')) {
file <- system.file(package = "doconv",
"doc-examples/example.pptx")
out <- pptx2pdf(input = file,
output = tempfile(fileext = ".pdf"))
if (file.exists(out)) {
message(basename(out), " is existing now.")
}
}