Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

media_extract

Extract media from a document object


Description

Extract files from an rdocx or rpptx object.

Usage

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

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)

officer

Manipulation of Microsoft Word and PowerPoint Documents

v0.3.18
GPL-3
Authors
David Gohel [aut, cre], Frank Hangler [ctb] (function body_replace_all_text), Liz Sander [ctb] (several documentation fixes), Anton Victorson [ctb] (fixes xml structures), Jon Calder [ctb] (update vignettes), John Harrold [ctb] (function annotate_base), John Muschelli [ctb] (google doc compatibility)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.