Skip to contents

pdf_add_cropmarks() adds crop marks to the edges of components of a print-and-play layout.

Usage

pdf_add_cropmarks(
  input,
  output = NULL,
  ...,
  layout = "poker_3x3",
  gp = gpar(),
  cm_width = unit(0.25, "mm"),
  cm_length = unit(0.125, "in")
)

Arguments

input

Input pdf filename.

output

Output pdf filename. NULL defaults to tempfile(fileext = ".pdf").

...

Passed to pdf_add_overlay().

layout

Either a layout preset name in layout_names() or a data frame with layout data (as returned by layout_grid()).

gp, cm_width, cm_length

Passed to piecepackr::grid.cropmark().

Value

output pdf file name invisibly. As a side effect adds crop marks to a pdf.

Examples

if (requireNamespace("piecepackr", quietly = TRUE)) {
  input <- pdf_create_blank(length = 2L, width = 11, height = 8.5)
  output <- pdf_add_cropmarks(input, pages = "odd",
                              layout = "button_shy_cards")
  unlink(input)
  unlink(output)
}
#> The original pdf contents were rasterized.
#> ℹ `any(pages != "all")` but `qpdf::pdf_overlay_stamp()` does not support a `pages` argument as of v1.4.1.
#> ℹ Suppress this message with `suppressMessages(expr, classes = "pnpmisc_message_rasterized")`.