media_extract: Extract media from a document object

Description Usage Arguments Examples

View source: R/fortify_pptx.R

Description

Extract files from an rdocx or rpptx object.

Usage

1
media_extract(x, path, target)

Arguments

x

an rpptx object or an rdocx object

path

media path, should be a relative path

target

target file

Examples

1
2
3
4
5
6
7
8
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/oxbase documentation built on July 30, 2018, 4:57 a.m.