library(officer)
str1 <- "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
str1 <- rep(str1, 20)
str1 <- paste(str1, collapse = " ")
ps <- prop_section(
page_size = page_size(orient = "landscape"),
page_margins = page_mar(top = 2),
type = "continuous"
)
doc_1 <- read_docx()
doc_1 <- body_add_par(doc_1, value = str1, style = "Normal")
doc_1 <- body_add_par(doc_1, value = str1, style = "Normal")
doc_1 <- body_end_block_section(doc_1, block_section(ps))
doc_1 <- body_add_par(doc_1, value = str1, style = "centered")
print(doc_1, target = tempfile(fileext = ".docx"))
Run the code above in your browser using DataLab