print_docx_pdf | R Documentation |
This function exports the document as a temporary .docx file, creates a temporary .vbs file with the intended .pdf file name, runs the .vbs file in command prompt, and then deletes the temporary files.
print_docx_pdf(x, target = NULL, ...)
x |
document created using 'read_docx()' function from 'officer' package |
target |
path to the .pdf to be exported, default is a .pdf with the exported object's name in the current working directory |
doc1 <- read_docx()
print_docx_pdf(doc1)
doc2 <- read_docx()
doc2 <- body_add_par(doc2, value = "Table of content", style = "heading 1")
doc2 <- body_add_toc(doc2, level = 2)
doc2 <- body_end_section_continuous(doc2)
doc2 <- body_add_par(doc2, value = "Section 1", style = "heading 1")
doc2 <- body_add_par(doc2, value = "This is a test.", style = "heading 2")
doc2 <- body_add_par(doc2, value = "Section 1", style = "heading 1")
print_docx_pdf(doc2, target = file.path(paste(getwd(),"/test.pdf",sep="")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.