Guest User

Untitled

a guest
Feb 13th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. library(magrittr)
  2.  
  3. def_text <- fp_text(color = "black", italic = FALSE, font.size = 20)
  4.  
  5. lastPhId <- function(presentation) {
  6. index = presentation$cursor
  7. x <- slide_summary(presentation, index = index)
  8. x <- x[x$type == "body", ]
  9. max(as.numeric(x$id))
  10. }
  11.  
  12. TITLE = fpar(ftext("My Title", prop = def_text))
  13. TITLE <- update(TITLE, fp_p = fp_par(text.align = "left"))
  14.  
  15. doc <- read_pptx()
  16. doc %<>% add_slide(layout = "Title and Content", master = "Office Theme")
  17. doc %<>% ph_empty_at(left = 3, top = 3, height = 1, width = 4, bg = "yellow")
  18. doc %<>% ph_add_fpar(value = TITLE, id_chr = lastPhId(doc))
  19.  
  20. print(doc, target = "ph_add_fpar.pptx")
  21. system("cmd.exe", input = "ph_add_fpar.pptx")
Add Comment
Please, Sign In to add comment