# NOT RUN {
fileout <- tempfile(fileext = ".pptx")
my_pres <- read_pptx()
my_pres <- add_slide(my_pres)
my_pres <- ph_with(my_pres, "",
location = ph_location_type(type = "body"))
small_red <- fp_text(color = "red", font.size = 14)
my_pres <- ph_add_text(my_pres, str = "A small red text.",
style = small_red)
my_pres <- ph_add_par(my_pres, level = 2)
my_pres <- ph_add_text(my_pres, str = "Level 2")
print(my_pres, target = fileout)
# another example ----
fileout <- tempfile(fileext = ".pptx")
doc <- read_pptx()
doc <- add_slide(doc)
doc <- ph_with(doc, "Un titre 2",
location = ph_location_type(type = "title"))
doc <- ph_with(doc, "",
location = ph_location(rotation = 90, bg = "red",
newlabel = "myph"))
doc <- ph_add_text(doc, str = "dummy text",
ph_label = "myph")
print(doc, target = fileout)
# }
Run the code above in your browser using DataLab