Skip to contents

Rotate pages in a pdf file

Usage

pdf_rotate_pages(
  input,
  pages,
  angle = 90,
  relative = FALSE,
  output = NULL,
  password = ""
)

Arguments

input

path or url to the input pdf file

pages

a vector with page numbers to rotate

angle

rotation angle in degrees (positive = clockwise)

relative

if TRUE, pages are rotated relative to their current orientation. If FALSE, rotation is absolute (0 = portrait, 90 = landscape, rotated 90 degrees clockwise from portrait)

output

base path of the output file(s)

password

string with password to open pdf file

Value

a character vector with the path of the rotated pdf file

Examples

pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf")
fout <- tempfile()
pdf_rotate_pages(pdf_file, 1, 90, FALSE, fout, "")
#> [1] "/tmp/RtmpOgvruH/file27fb4165bc58c.pdf"