Package 'certify'

Title: Generate Branded PDF Certificates
Description: Produces formal landscape PDF certificates with configurable color themes, optional logos, decorative borders, laurels, and corner ornaments. Built on 'grid' with no external 'LaTeX' or 'Quarto' dependency. Suitable for academic awards, professional recognition, and similar uses.
Authors: Cameron Wimpy [aut, cre, cph]
Maintainer: Cameron Wimpy <[email protected]>
License: MIT + file LICENSE
Version: 0.2.0
Built: 2026-10-17 06:12:35 UTC
Source: https://github.com/cwimpy/certify

Help Index


Build a certificate color theme

Description

Constructs a color palette used by make_certificate() to render borders, ornaments, and text. Supply your own colors, or use one of the preset themes (cert_theme_classic(), cert_theme_formal(), cert_theme_warm()).

Usage

cert_theme(
  primary = "#1a3a5c",
  primary_dark = "#0f2540",
  accent = "#b08d3e",
  accent_light = "#d4b26a",
  ink = "#1a1a1a",
  soft_ink = "#4a4a4a",
  background = "#fbf8f1",
  hairline = "#c9a961"
)

Arguments

primary

Border and accent color (any hex or named R color). Used for the outer border, the title text, and the accent diamond in the divider.

primary_dark

A darker variant of primary, used for the academic-year line and laurel outlines.

accent

Secondary accent color, typically a metallic such as gold, bronze, or silver. Used for inner borders and corner arcs.

accent_light

Lighter version of accent, used as the leaf fill in the laurel ornaments.

ink

Main body text color.

soft_ink

Italic / subdued text color (subtitles, dates).

background

Page fill color.

hairline

Thin inner-border and underline color.

Value

A cert_theme object: a named list of color strings.

Examples

my_theme <- cert_theme(primary = "#003366", accent = "#c0a062")

Preset certificate themes

Description

Convenience wrappers around cert_theme() for common looks.

Usage

cert_theme_classic()

cert_theme_formal()

cert_theme_warm()

Details

  • cert_theme_classic() — navy and gold on parchment.

  • cert_theme_formal() — black and silver on cream.

  • cert_theme_warm() — burgundy and gold on warm cream.

Value

A cert_theme object.

Examples

th <- cert_theme_classic()
th$primary

Generate a PDF certificate

Description

Renders a single landscape PDF certificate with decorative borders, corner ornaments, optional laurels around the recipient name, and one or two signature blocks. The output is drawn entirely with the grid graphics system; no LaTeX or Quarto installation is required.

Usage

make_certificate(
  path,
  recipient,
  title = "Certificate of Achievement",
  award_name = NULL,
  organization = NULL,
  program = NULL,
  presented_text = "This certificate is proudly presented to",
  citation = "",
  academic_year = NULL,
  date_str = format(Sys.Date(), "%B %Y"),
  signers = list(list(name = "", title = "")),
  logo = NULL,
  logo_height = 2,
  logo_width = 4.5,
  theme = cert_theme_classic(),
  paper = "letter",
  width = NULL,
  height = NULL,
  show_laurels = TRUE,
  device = c("cairo_pdf", "pdf")
)

Arguments

path

File path for the output PDF. Required.

recipient

Name of the person receiving the certificate.

title

Main heading. Defaults to "Certificate of Achievement".

award_name

Optional subtitle, rendered in upper-case (for example, "Outstanding Graduate").

organization

Optional name of the issuing organization. Used in the header when no logo is supplied.

program

Optional italic line shown beneath award_name (for example, "Bachelor of Arts in Political Science").

presented_text

Lead-in text immediately above the recipient name. Defaults to "This certificate is proudly presented to".

citation

Italic citation paragraph displayed beneath the recipient name. Will be soft-wrapped to fit the page.

academic_year

Optional academic-year line (for example, "2025-2026").

date_str

Date displayed in the signature block. Defaults to the current month and year.

signers

A list of one or two signers. Each signer is itself a list with name and title character entries. With one signer the layout shows a date line on the right; with two signers the date appears centered below the signature row.

Optional path to a PNG logo. When provided, the image is centered in the header and organization is ignored.

logo_height, logo_width

Maximum logo size in inches. The image is scaled to fit inside this box without distorting its proportions, so whichever limit it reaches first wins: a tall or squarish logo is limited by logo_height (2 inches by default), while a wide wordmark is limited by logo_width (4.5 inches by default) and renders shorter than logo_height. Raise logo_width to let a wide logo run closer to the border, or lower both to make any logo smaller.

theme

A cert_theme object controlling colors. See cert_theme() and the preset variants.

paper

Named paper size, matched case-insensitively: "letter" (the default), "legal", "tabloid", "a3", "a4", or "a5". All are landscape. The design is drawn for an 11 x 8.5 page and scaled proportionally to whatever size is chosen, so type and ornament sizes grow with the paper rather than staying letter-sized on a large sheet.

width, height

Page dimensions in inches, overriding paper when supplied. Leave as NULL to use the named size.

show_laurels

Logical; if TRUE (the default), draw decorative laurel sprays flanking the recipient name.

device

Either "cairo_pdf" or "pdf". If left unset, cairo is used when it is actually usable and the base pdf device is used otherwise, so no argument is needed on machines missing Cairo. Cairo renders Unicode glyphs (en-dashes, em-dashes, smart quotes) cleanly and is the recommended choice. The base "pdf" device is more portable — it has no system dependency on Cairo / XQuartz — but silently downgrades non-ASCII characters to hyphens. Passing "cairo_pdf" explicitly skips the fallback and will fail on systems without Cairo (some macOS installations without XQuartz, stripped Linux containers, etc.).

Value

The output path, returned invisibly.

Layout

The page is US-letter landscape by default (11 x 8.5 inches), which prints as-is on standard paper at 100% scale. Pass paper for another named size, or width and height for an arbitrary one. The header region shows either an image (if logo is supplied) or a wordmark constructed from organization. Below the header, the certificate shows a divider, the title, an optional award subtitle and program line, the recipient name, the citation, an optional academic year, and the signature block(s).

Examples

out <- tempfile("certify_", fileext = ".pdf")
make_certificate(
  path          = out,
  recipient     = "Jane A. Doe",
  title         = "Certificate of Achievement",
  award_name    = "Outstanding Student",
  organization  = "University of Somewhere",
  citation      = "in recognition of exceptional dedication and scholarship.",
  academic_year = "2025-2026",
  signers       = list(
    list(name = "Alex Chair, Ph.D.", title = "Department Chair")
  ),
  device        = "pdf"   # omit this to pick the best device available
)
file.exists(out)

Generate certificates from a data frame

Description

Produces one PDF per row of data, for a class roster, an awards ceremony, or any other list of recipients. Columns whose names match arguments of make_certificate() are used row by row; anything constant across the whole batch is passed through ....

Usage

make_certificates(data, dir = ".", filename = NULL, quiet = FALSE, ...)

Arguments

data

A data frame with one row per certificate.

dir

Directory for the output PDFs. Created if it does not exist.

filename

Optional character vector of file names, one per row. By default names are derived from recipient ("Jane A. Doe" becomes "jane-a-doe.pdf"), or taken from a filename column if data has one. Duplicates get a numeric suffix so no file is silently overwritten.

quiet

If TRUE, suppress the summary message.

...

Arguments passed to make_certificate() for every row, such as logo, theme, signers, paper, or title.

Value

A character vector of the paths written, invisibly.

Columns

A recipient column is required unless recipient is supplied through .... Any other column named after a make_certificate() argument is used as well, so a spreadsheet with recipient, award_name, and citation columns gives each person their own award and wording. Columns that do not match an argument are ignored, and the ignored names are reported so a misspelled heading is easy to spot. Empty cells (NA) fall back to whatever was passed in ..., or to the default.

If a column and a ... argument have the same name, the column wins, since per-row values are the more specific of the two.

Examples

roster <- data.frame(
  recipient  = c("Jane A. Doe", "John B. Smith"),
  award_name = c("Outstanding Student", "Outstanding Service"),
  citation   = c("for exceptional scholarship.",
                 "for years of devoted service.")
)

out <- file.path(tempdir(), "certificates")
files <- make_certificates(
  roster,
  dir          = out,
  organization = "University of Somewhere",
  signers      = list(
    list(name = "Alex Chair, Ph.D.", title = "Department Chair")
  ),
  device       = "pdf",
  quiet        = TRUE
)
basename(files)