Skip to contents

pdf_add_rects() adds (rounded) rectangles around components of a print-and-play layout.

Usage

pdf_add_rects(
  input,
  output = NULL,
  ...,
  layout = "poker_3x3",
  r = unit(0, "in"),
  gp = gpar(col = "black", fill = NA, lwd = 1)
)

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()).

r, gp

Passed to grid::grid.roundrect().

Value

output pdf file name invisibly. As a side effect creates pdf file with added rectangles.

Details

  • Sometimes if you use the same color as a solid background color this can be used to effectively "remove" unwanted card outlines.

Examples

f1 <- pdf_create_blank(length = 2L, paper = "letter")
f2 <- pdf_add_rects(f1, layout = "poker_3x3")
# "Remove" unwanted card border lines by covering up with white
f3 <- pdf_add_rects(f2, layout = "poker_3x3",
                    gp = grid::gpar(col = "white", fill = NA, lwd = 2))
unlink(f1)
unlink(f2)
unlink(f3)