pdfPageExtract: Interface to 'gs' to extract a range of pages from a PDF file

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Extract a range of pages from a PDF file. Preserves hyperlinks that fall within the selected page range.

Usage

1
pdfPageExtract(fileName, firstP = NULL, lastP = NULL, outFileName = NULL)

Arguments

fileName

character string denoting the path/ name of the input PDF file

firstP

integer denoting the first extracted page

lastP

integer denoting the last extracted page

outFileName

character string denoting the name of the output PDF file. If not specified, it is "[fileName]_pages[firstP]_[lastP].pdf".

Value

Returns nothing, but as a side effect saves the extracted pages as a new .pdf file.

Note

This function is based on Ghostscript.

Author(s)

Christoph Schmidt <schmidtchristoph@users.noreply.github.com>

See Also

GPL Ghostscript https://www.ghostscript.com

Examples

1
2
3
4
5
6
7
8
library(d3heatmap)
p <- d3heatmap(mtcars, scale = "column", colors = "Blues")
# pdf contains three pages (1 plot, 2 empty ones)
jsGraphic2Pdf(p, c(2500, 2000, 50, 50))
pdfPageExtract("JSgraphic.pdf", 1, 1)
pdfPageExtract("JSgraphic.pdf", 1, 1, "JSgraphic.pdf")

file.remove("JSgraphic.pdf", "JSgraphic_pages1_1.pdf", "JSgraphic_extr.pdf")

schmidtchristoph/js2graphic documentation built on May 21, 2019, 10:08 a.m.