Skip to contents

pdf_create_wallet() creates print-and-play card origami wallets pdfs.

Usage

pdf_create_wallet(
  output = NULL,
  ...,
  front = NULL,
  back = NULL,
  spine = NULL,
  bleed = unit(0, "in"),
  paper = getOption("papersize", "letter")
)

Arguments

output

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

...

Ignored.

front

Fill color/pattern/gradient or grob for front cover section of wallet. Will be drawn in a rotated masked viewport with a width of 2 + 2 * bleed inches and a height of 8 + 2 * bleed inches. If NULL (default) we draw a template.

back

Fill color/pattern/gradient or grob for back cover section of wallet. Will be drawn in a rotated masked viewport with a width of 2 * 2 * bleed inches and a height of 8 + 2 * bleed inches. If NULL (default) we draw a template.

spine

Fill color/pattern/gradient or grob for spine section of wallet. Will be drawn in a masked viewport with a width of 8 + 2 * bleed inches and a height of 6 + 2 * bleed inches. If NULL (default) we draw a template.

bleed

Bleed zone size to assume:

  • If bleed is a grid::unit() simply use it

  • If bleed is numeric then convert via grid::unit(bleed, "in")

  • If bleed is TRUE assume 1/8 inch bleed zone size

  • If bleed is FALSE assume 0 inch bleed zone size

paper

Paper size. Usually either "letter" or "a4" but in certain circumstances can be one of "letter", "a4", "poker", "bridge", "legal", "a5", "a3", "special".

Value

output pdf file name invisibly. As a side effect creates a print-and-play card wallet pdf file.

Details

To make the wallets from the pdf files:

  1. Print out two-sided flipping on the long edge

  2. Using the crop marks on the first page (the page showing the "spine") trim the edges with a cutting tool (the four dots should now be at the corner of each page).

  3. Make the four corner valley folds each labeled "Folds 1"

  4. Make the two valley folds each labeled "Folds 2"

  5. Flip over the paper and make the two valley folds each labeled "Folds 3"

  6. Fold in half (valley fold)

Examples

# Template `front`, `back`, and `spine`
if (requireNamespace("piecepackr", quietly = TRUE) &&
    getRversion() >= "4.1") {
  f1 <- pdf_create_wallet()
  unlink(f1)
}

# Fill `front`, `back`, and `spine`
if (requireNamespace("piecepackr", quietly = TRUE) &&
    getRversion() >= "4.1") {
f2 <- pdf_create_wallet(front = "red", back = "blue", spine = "purple")
unlink(f2)
}

# Grob `front`, `back`, and `spine` with bleed
if (requireNamespace("piecepackr", quietly = TRUE) &&
    getRversion() >= "4.1" &&
    require("gridpattern", quietly = TRUE)) {
  pal <- grDevices::palette()
  herringbone <- patternGrob("polygon_tiling", type = "herringbone",
                             fill = pal[2], spacing = 0.1)
  rhombille <- patternGrob("polygon_tiling", type = "rhombille",
                           fill = pal[3], spacing = 0.2)
  pythagorean <- patternGrob("polygon_tiling", type = "pythagorean",
                             fill = pal[4], spacing = 0.1)
  f3 <- pdf_create_wallet(front = herringbone, back = rhombille,
                          spine = pythagorean, bleed = TRUE)
  unlink(f3)
}