Skip to contents

pdf_scale() scales the contents of a pdf centered within the page.

Usage

pdf_scale(input, output = NULL, ..., scale)

Arguments

input

Input pdf filename.

output

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

...

Passed to pdf_apply().

scale

A numeric scalar to scale the content by. Values less than 1 shrink the content within the page; values greater than 1 enlarge it. By default the original content is not rescaled. Note this also adjusts the size of the grid::viewport() the grid_fn will draw in.

Value

output pdf file name invisibly. As a side effect creates a scaled pdf file.

Examples

input <- pdf_create_blank(paper = "letter", bg = "blue")
output <- pdf_scale(input, scale = 0.9, dpi = 75)
pdf_width(output)
#> [1] 8.5inches
pdf_height(output)
#> [1] 11inches
unlink(input)
unlink(output)