combine_pdf {staplr} | R Documentation |
Combine multiple PDF files
Description
Combine multiple PDF files by delimiting the sequences of pages in each file.
Usage
combine_pdf(vec_input, output = "output.pdf", start_pages = NA, end_pages = NA)
Arguments
vec_input |
Vector with paths of PDF files to be combined. |
output |
PDF file path result of the combination. |
start_pages |
Vector with the initial pages of each file. If |
end_pages |
Vector with the final pages of each file. If |
Value
In the path informed in output
, the PDF file resulting from the combination
of multiple files passed to vec_output
will be saved.
Examples
if (requireNamespace("lattice", quietly = TRUE)) {
dir <- tempfile()
dir.create(dir)
for(i in 1:2) {
pdf(file.path(dir, paste("plot", i, ".pdf", sep = "")))
print(lattice::xyplot(iris[,1] ~ iris[,i], data = iris))
dev.off()
}
output <- tempfile(fileext = '.pdf')
combine_pdf(
vec_input =
file.path(dir, paste("plot", 1:2, ".pdf", sep = "")),
output = output,
start_pages = c(NA, NA),
end_pages = c(NA, NA)
)
}
[Package staplr version 3.2.2 Index]