% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/certificate.R
\name{make_certificate}
\alias{make_certificate}
\title{Generate a PDF certificate}
\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,
  theme = cert_theme_classic(),
  width = 11,
  height = 8.5,
  show_laurels = TRUE,
  device = c("cairo_pdf", "pdf")
)
}
\arguments{
\item{path}{File path for the output PDF. Required.}

\item{recipient}{Name of the person receiving the certificate.}

\item{title}{Main heading. Defaults to \code{"Certificate of Achievement"}.}

\item{award_name}{Optional subtitle, rendered in upper-case (for
example, \code{"Outstanding Graduate"}).}

\item{organization}{Optional name of the issuing organization. Used
in the header when no \code{logo} is supplied.}

\item{program}{Optional italic line shown beneath \code{award_name} (for
example, \code{"Bachelor of Arts in Political Science"}).}

\item{presented_text}{Lead-in text immediately above the recipient
name. Defaults to \code{"This certificate is proudly presented to"}.}

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

\item{academic_year}{Optional academic-year line (for example,
\code{"2025-2026"}).}

\item{date_str}{Date displayed in the signature block. Defaults to
the current month and year.}

\item{signers}{A list of one or two signers. Each signer is itself a
list with \code{name} and \code{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.}

\item{logo}{Optional path to a PNG logo. When provided, the image is
centered in the header and \code{organization} is ignored.}

\item{theme}{A \code{cert_theme} object controlling colors. See
\code{\link[=cert_theme]{cert_theme()}} and the preset variants.}

\item{width, height}{Page dimensions in inches. Defaults give US
letter landscape (11 x 8.5).}

\item{show_laurels}{Logical; if \code{TRUE} (the default), draw decorative
laurel sprays flanking the recipient name.}

\item{device}{Either \code{"cairo_pdf"} (the default) or \code{"pdf"}. Cairo
renders Unicode glyphs (en-dashes, em-dashes, smart quotes) cleanly
and is the recommended choice. The base \code{"pdf"} device is more
portable — it has no system dependency on Cairo / XQuartz — but
silently downgrades non-ASCII characters to hyphens. Use \code{"pdf"}
if you see "failed to load cairo DLL" warnings or segfaults on
systems without Cairo (some macOS installations without XQuartz,
stripped Linux containers, etc.).}
}
\value{
The output \code{path}, returned invisibly.
}
\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
\code{grid} graphics system; no LaTeX or Quarto installation is required.
}
\section{Layout}{

The page is US-letter landscape by default (11 x 8.5 inches). Pass
\code{width} and \code{height} to render any other size. The header region
shows either an image (if \code{logo} is supplied) or a wordmark
constructed from \code{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"   # use "cairo_pdf" (default) for proper Unicode
)
file.exists(out)
}
