| 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 |
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()).
cert_theme( primary = "#1a3a5c", primary_dark = "#0f2540", accent = "#b08d3e", accent_light = "#d4b26a", ink = "#1a1a1a", soft_ink = "#4a4a4a", background = "#fbf8f1", hairline = "#c9a961" )cert_theme( primary = "#1a3a5c", primary_dark = "#0f2540", accent = "#b08d3e", accent_light = "#d4b26a", ink = "#1a1a1a", soft_ink = "#4a4a4a", background = "#fbf8f1", hairline = "#c9a961" )
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 |
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 |
ink |
Main body text color. |
soft_ink |
Italic / subdued text color (subtitles, dates). |
background |
Page fill color. |
hairline |
Thin inner-border and underline color. |
A cert_theme object: a named list of color strings.
my_theme <- cert_theme(primary = "#003366", accent = "#c0a062")my_theme <- cert_theme(primary = "#003366", accent = "#c0a062")
Convenience wrappers around cert_theme() for common looks.
cert_theme_classic() cert_theme_formal() cert_theme_warm()cert_theme_classic() cert_theme_formal() cert_theme_warm()
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.
A cert_theme object.
th <- cert_theme_classic() th$primaryth <- cert_theme_classic() th$primary
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.
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") )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") )
path |
File path for the output PDF. Required. |
recipient |
Name of the person receiving the certificate. |
title |
Main heading. Defaults to |
award_name |
Optional subtitle, rendered in upper-case (for
example, |
organization |
Optional name of the issuing organization. Used
in the header when no |
program |
Optional italic line shown beneath |
presented_text |
Lead-in text immediately above the recipient
name. Defaults 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,
|
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 |
logo |
Optional path to a PNG logo. When provided, the image is
centered in the header and |
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 |
theme |
A |
paper |
Named paper size, matched case-insensitively: |
width, height
|
Page dimensions in inches, overriding |
show_laurels |
Logical; if |
device |
Either |
The output path, returned invisibly.
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).
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)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)
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 ....
make_certificates(data, dir = ".", filename = NULL, quiet = FALSE, ...)make_certificates(data, dir = ".", filename = NULL, quiet = FALSE, ...)
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 |
quiet |
If |
... |
Arguments passed to |
A character vector of the paths written, invisibly.
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.
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)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)