Skip to contents

Saves a poster() object at its real paper size (e.g. 594x841mm for A1). The output format is chosen from file's extension: .pdf uses grDevices::cairo_pdf (vector output with CJK glyph embedding), anything else uses ragg::agg_png.

Usage

render_poster(x, file, scale = 1, dpi = 300, show_plot_area = FALSE)

Arguments

x

A ggposter object, as returned by poster().

file

Output file path. Extension determines the device (.pdf or .png).

scale

Shrink factor applied to the true paper size, e.g. 0.25 for an A4-sized preview of an A1 poster. Font/line sizes stay proportional because the whole canvas (not just DPI) is scaled.

dpi

Resolution for PNG output. Ignored for PDF.

show_plot_area

If TRUE, output a version with a dashed border drawn around each card's content area (header tab, and each body / notes column), on top of the content without hiding it. Useful for checking a layout. It's an output option, not part of the poster's content, so the same x renders both the normal and the outlined version without rebuilding it yourself.

Value

The output file path, invisibly.

Examples

if (FALSE) { # \dontrun{
p <- poster(spec)
render_poster(p, "poster.pdf")
render_poster(p, "preview.png", scale = 0.25)
render_poster(p, "layout-check.png", scale = 0.25, show_plot_area = TRUE)
} # }