Title: | Split, Combine and Compress PDF Files |
---|---|
Description: | Bindings to 'qpdf': 'qpdf' (<https://qpdf.sourceforge.io/>) is a an open-source PDF rendering library that allows to conduct content-preserving transformations of PDF files such as split, combine, and compress PDF files. |
Authors: | Mauricio Vargas Sepulveda [aut, cre] , Jeroen Ooms [aut] (Author of qpdf R package, <https://orcid.org/0000-0002-4035-0289>), Ben Raymond [ctb], Jay Berkenbilt [cph] (Author of qpdf), Munk School of Global Affairs and Public Policy [fnd] |
Maintainer: | Mauricio Vargas Sepulveda <[email protected]> |
License: | Apache License (>= 2) |
Version: | 1.3.5 |
Built: | 2024-12-20 10:44:57 UTC |
Source: | CRAN |
Bindings to 'cpp11qpdf': A tool for content-preserving transformations of PDF files such as split, combine, and compress.
Maintainer: Mauricio Vargas Sepulveda [email protected] (ORCID)
Authors:
Jeroen Ooms [email protected] (ORCID) (Author of qpdf R package)
Other contributors:
Ben Raymond [contributor]
Jay Berkenbilt (Author of qpdf) [copyright holder]
Munk School of Global Affairs and Public Policy [funder]
Useful links:
Combine multiple pdf files into a single pdf file
pdf_combine(input, output = NULL, password = "")
pdf_combine(input, output = NULL, password = "")
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 |
a character vector with the path of the combined pdf file
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_combine(pdf_file, fout, "")
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_combine(pdf_file, fout, "")
Compress a pdf file
pdf_compress(input, output = NULL, linearize = FALSE, password = "")
pdf_compress(input, output = NULL, linearize = FALSE, password = "")
input |
path or url to the input pdf file |
output |
base path of the output file(s) |
linearize |
enable pdf linearization (streamable pdf) |
password |
string with password to open pdf file |
a character vector with the path of the compressed pdf file
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_compress(pdf_file, fout, TRUE, "")
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_compress(pdf_file, fout, TRUE, "")
Get the number of pages in a pdf file
pdf_length(input, password = "")
pdf_length(input, password = "")
input |
path or url to the input pdf file |
password |
string with password to open pdf file |
an integer value with the number of pages in the pdf file
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") pdf_length(pdf_file, "")
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") pdf_length(pdf_file, "")
Overlay a pdf file into another pdf file
pdf_overlay_stamp(input, stamp, output = NULL, password = "")
pdf_overlay_stamp(input, stamp, output = NULL, password = "")
input |
path or url to the input pdf file |
stamp |
pdf file of which the first page is overlayed into each page of input |
output |
base path of the output file(s) |
password |
string with password to open pdf file |
a character vector with the path of the stamped pdf file
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") stamp_file <- system.file("examples", "header.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_overlay_stamp(pdf_file, stamp_file, fout, "")
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") stamp_file <- system.file("examples", "header.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_overlay_stamp(pdf_file, stamp_file, fout, "")
Rotate pages in a pdf file
pdf_rotate_pages( input, pages, angle = 90, relative = FALSE, output = NULL, password = "" )
pdf_rotate_pages( input, pages, angle = 90, relative = FALSE, output = NULL, password = "" )
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 |
output |
base path of the output file(s) |
password |
string with password to open pdf file |
a character vector with the path of the rotated pdf file
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_rotate_pages(pdf_file, 1, 90, FALSE, fout, "")
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_rotate_pages(pdf_file, 1, 90, FALSE, fout, "")
Split a pdf file into individual pages
pdf_split(input, output = NULL, password = "")
pdf_split(input, output = NULL, password = "")
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 |
a character vector with the paths of the split pdf files
# extract some pages pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_split(pdf_file, fout, password = "")
# extract some pages pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_split(pdf_file, fout, password = "")
Subset a pdf file to a new pdf file containing the selected pages
pdf_subset(input, pages = 1, output = NULL, password = "")
pdf_subset(input, pages = 1, output = NULL, password = "")
input |
path or url to the input pdf file |
pages |
a vector with page numbers to select. Negative numbers means removing those pages (same as R indexing) |
output |
base path of the output file(s) |
password |
string with password to open pdf file |
a character vector with the path of the subsetted pdf file
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_subset(pdf_file, 1, fout, "")
pdf_file <- system.file("examples", "sufganiyot.pdf", package = "cpp11qpdf") fout <- tempfile() pdf_subset(pdf_file, 1, fout, "")