media_extract: Extract media from a document object

View source: R/fortify_pptx.R

media_extractR Documentation

Extract media from a document object

Description

Extract files from a rpptx object.

Usage

media_extract(x, path, target)

Arguments

x

an rpptx object

path

media path, should be a relative path

target

target file

Examples

example_pptx <- system.file(package = "officer",
  "doc_examples/example.pptx")
doc <- read_pptx(example_pptx)
content <- pptx_summary(doc)
image_row <- content[content$content_type %in% "image", ]
media_file <- image_row$media_file
png_file <- tempfile(fileext = ".png")
media_extract(doc, path = media_file, target = png_file)

davidgohel/officer documentation built on March 18, 2024, 4:06 p.m.