pdf_rep() repeats pages of a pdf similar to base::rep().
Usage
pdf_rep(
input,
output = NULL,
...,
pages = "all",
times = 1L,
length.out = NA_integer_,
each = 1L
)Arguments
- input
Input pdf filename.
- output
Output pdf filename.
NULLdefaults totempfile(fileext = ".pdf").- ...
Ignored.
- pages
A positive numeric vector of pages to include, a negative numeric vector of pages to exclude, or a string:
- all
Include all the pages.
- even
Include just the even pages.
- odd
Include just the odd pages.
The functions
pdf_pages()andpdf_subset()also support the string:- 2-up saddle stitch
The order of the pages to create a saddle-stitch booklet if printing 2-up.
- interleave
Interleave the first and second halves of the pages. Requires an even number of pages.
- interleave_first
Repeat the first page
n - 1times and interleave with the remainingn - 1pages.- interleave_last
Repeat the last page
n - 1times and interleave with the firstn - 1pages.
- times, length.out, each
Passed to
base::rep().
Examples
f1 <- pdf_create_blank(length = 3L, paper = "letter")
f2 <- pdf_rep(f1, times = 2L)
f3 <- pdf_rep(f1, pages = 1:2, each = 2L)
unlink(f1)
unlink(f2)
unlink(f3)