qpdf {qpdf}R Documentation

Split, Combine and Compress PDF Files

Description

Content-preserving transformations transformations of PDF files. Note qpdf does not read actual content from PDF files: to extract text and data you need the pdftools package.

Usage

pdf_split(input, output = NULL, password = "")

pdf_length(input, password = "")

pdf_subset(input, pages = 1, output = NULL, password = "")

pdf_combine(input, output = NULL, password = "")

pdf_compress(input, output = NULL, linearize = FALSE, password = "")

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

Arguments

input

path or url to the input pdf file

output

base path of the output file(s)

password

string with password to open pdf file

pages

a vector with page numbers to rotate

linearize

enable pdf linearization (streamable pdf)

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)

Details

Currently the package provides the following wrappers:

These functions do not modify the input file: they create new output file(s) and return the path(s) to these newly created files.

Examples


# extract some pages
pdf_file <- file.path(tempdir(), "output.pdf")
pdf_subset('/usr/share/doc/R/manual/R-intro.pdf',
  pages = 1:3, output = pdf_file)
pdf_length(pdf_file)
unlink(pdf_file)


[Package qpdf version 1.2.0 Index]