# NOT RUN {
fileout <- tempfile(fileext = ".pptx")
doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
img.file <- file.path( Sys.getenv("R_HOME"), "doc", "html", "logo.jpg" )
if( file.exists(img.file) ){
doc <- ph_with_img(x = doc, type = "body", src = img.file, height = 1.06, width = 1.39 )
}
if( require("ionicons") ){
calendar_src = as_png(name = "calendar", fill = "#FFE64D", width = 144, height = 144)
doc <- ph_with_img(x = doc, type = "dt", src = calendar_src )
}
print(doc, target = fileout )
fileout <- tempfile(fileext = ".pptx")
doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
img.file <- file.path( Sys.getenv("R_HOME"), "doc", "html", "logo.jpg" )
if( file.exists(img.file) ){
doc <- ph_with_img_at(x = doc, src = img.file, height = 1.06, width = 1.39,
left = 4, top = 4, rot = 45 )
}
print(doc, target = fileout )
# }
Run the code above in your browser using DataCamp Workspace