Learn R Programming

officer (version 0.7.2)

base64_to_image: Convert Data URIs to PNG Files

Description

Decodes base64-encoded data URIs and writes them to PNG files.

Usage

base64_to_image(data_uri, output_files)

Value

Character, the paths to the created PNG files

Arguments

data_uri

Character, a data URI character vector starting with "data:image/png;base64,"

output_files

Character, paths to the output PNG files

Examples

Run this code
rlogo <- file.path(R.home("doc"), "html", "logo.jpg")
base64_str <- image_to_base64(rlogo)
base64_to_image(
  data_uri = base64_str,
  output_files = tempfile(fileext = ".jpeg")
)

Run the code above in your browser using DataLab