| Type: | Package | 
| Title: | Split, Combine and Compress PDF Files | 
| Version: | 1.4.1 | 
| Description: | Content-preserving transformations transformations of PDF files such as split, combine, and compress. This package interfaces directly to the 'qpdf' C++ library https://qpdf.sourceforge.io/ and does not require any command line utilities. Note that 'qpdf' does not read actual content from PDF files: to extract text and data you need the 'pdftools' package. | 
| License: | Apache License 2.0 | 
| URL: | https://docs.ropensci.org/qpdf/ https://ropensci.r-universe.dev/qpdf | 
| BugReports: | https://github.com/ropensci/qpdf/issues | 
| Encoding: | UTF-8 | 
| Imports: | Rcpp, askpass, curl | 
| LinkingTo: | Rcpp | 
| RoxygenNote: | 7.2.1 | 
| Suggests: | testthat | 
| SystemRequirements: | libjpeg | 
| NeedsCompilation: | yes | 
| Packaged: | 2025-06-30 11:12:14 UTC; jeroen | 
| Author: | Jeroen Ooms | 
| Maintainer: | Jeroen Ooms <jeroenooms@gmail.com> | 
| Repository: | CRAN | 
| Date/Publication: | 2025-07-02 09:40:02 UTC | 
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_overlay_stamp(input, stamp, output = NULL, 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) | 
| stamp | pdf file of which the first page is overlayed into each page of input | 
| angle | rotation angle in degrees (positive = clockwise) | 
| relative | if  | 
Details
Currently the package provides the following wrappers:
-  pdf_length: show the number of pages in a pdf 
-  pdf_split: split a single pdf into separate files, one for each page 
-  pdf_subset: create a new pdf with a subset of the input pages 
-  pdf_combine: join several pdf files into one 
-  pdf_compress: compress or linearize a pdf file 
-  pdf_rotate_pages: rotate selected pages 
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('https://cran.r-project.org/doc/manuals/r-release/R-intro.pdf',
  pages = 1:3, output = pdf_file)
pdf_length(pdf_file)
unlink(pdf_file)