View source: R/save_print_and_play.R
save_print_and_play | R Documentation |
Save piecepack print-and-play (PnP) file
save_print_and_play(
cfg = getOption("piecepackr.cfg", pp_cfg()),
output_filename = "piecepack.pdf",
size = c("letter", "A4", "A5", "4x6"),
pieces = NULL,
arrangement = c("single-sided", "double-sided"),
dev = NULL,
dev.args = list(family = cfg$fontfamily, onefile = TRUE, units = "in", bg = "white",
res = 300),
quietly = FALSE,
...,
bleed = FALSE,
size_bleed = NULL
)
cfg |
Piecepack configuration list or |
output_filename |
Filename for print-and-play file |
size |
PnP output size (currently supports either "letter", "A4", "A5", or "4x6").
This is the targeted “trim” size of the print-and-play file
( |
pieces |
Character vector of desired PnP pieces.
Supports "piecepack", "matchsticks", "pyramids", "subpack", or "all".
If |
arrangement |
Either "single-sided" or "double-sided".
Ignored if |
dev |
Graphics device function to use. If |
dev.args |
Additional arguments to pass to |
quietly |
Whether to hide messages about missing metadata in the provided configuration. |
... |
Currently ignored. |
bleed |
If |
size_bleed |
A list with names "top", "right", "bottom", "left"
containing numeric values indicating the inches "bleed" to add to
the |
# May take more than 5 seconds on CRAN servers
if (capabilities("cairo")) {
cfg <- pp_cfg(list(invert_colors.suited=TRUE))
cfg$description <- 'Piecepack with an "inverted" color scheme.'
cfg$title <- '"Inverted" piecepack'
cfg$copyright <- "\u00a9 2022 Trevor L Davis. Some Right Reserved."
cfg$spdx_id <- "CC-BY-4.0"
cfg$credit <- ""
file <- tempfile("my_pnp_file", fileext = ".pdf")
file_ds <- tempfile("my_pnp_file_ds", fileext = ".pdf")
file_a4 <- tempfile("my_pnp_file_a4", fileext = ".pdf")
file_a5 <- tempfile("my_pnp_file_a5", fileext = ".pdf")
save_print_and_play(cfg, file)
save_print_and_play(cfg, file_ds, arrangement="double-sided")
save_print_and_play(cfg, file_a4, size="A4", pieces="all")
save_print_and_play(cfg, file_a5, size="A5")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.