image_to_pdf: Convert images to PDF

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

This helper function converts a vector of images to a single PDF.

Usage

1
image_to_pdf(files, pdf_name)

Arguments

files

a vector of image files

pdf_name

a string with the name of the new PDF

Details

Combines any number of image files of almost any type to a single PDF. The vector can consist of different image file types. See the 'Magick' package documentation https://cran.r-project.org/package=magick for details on supported file types. Note that on Linux, ImageMagick may not allow conversion to pdf for security reasons.

Value

no return value, called for side effects

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# Single file
new_pdf <- file.path(tempdir(), "document.pdf")
image_to_pdf("document.jpg", new_pdf)

# A vector of image files:
image_to_pdf(images)

## End(Not run)

daiR documentation built on June 11, 2021, 5:16 p.m.