Skip to contents

bm_crop_layout() crops out a print-and-play component from a layout.

Usage

bm_crop_layout(
  page,
  ...,
  layout = "button_shy_cards",
  row = 1L,
  col = 1L,
  bleed = FALSE,
  name = NULL
)

Arguments

page

A bittermelon::bm_pixmap() object representing a print-and-play layout page. Often the output from pdf_render_bm_pixmap().

...

Ignored for now.

layout

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

row, col

The row and col of the component in the layout (integers).

bleed

Include the bleed (if available).

name

Instead of row and col can instead use the name of the component in the layout (string).

Value

A bittermelon::bm_pixmap() object.

See also

bm_split_layout() to extract all components from the layout

Examples

if (FALSE) # User not expected to have this PDF file
if (requireNamespace("bittermelon", quietly = TRUE)) {
  input <- "A Nice Cuppa - PNP.pdf"
  page <- pdf_render_bm_pixmap(input, page = 4L, dpi = 75)
  card <- bm_crop_layout(page, layout = "button_shy_cards", row = 1L, col = 1L)
  grid::grid.raster(card)
}
 # \dontrun{}