ph_with_text

0th

Percentile

add text into a new shape

add text into a new shape in a slide. This function will be deprecated in favor of ph_with in the next release.

Usage
ph_with_text(x, str, type = "title", index = 1, location = NULL)
Arguments
x

a pptx device

str

text to add

type

placeholder type (i.e. 'body', 'title')

index

placeholder index (integer). This is to be used when a placeholder type is not unique in the current slide, e.g. two placeholders with type 'body', the first one will be added with index 1 and the second one with index 2. It is recommanded to use argument location instead of type and index.

location

a placeholder location object. This is a convenient argument that can replace usage of arguments type and index. See ph_location_type, ph_location, ph_location_label, ph_location_left, ph_location_right, ph_location_fullsize.

Aliases
  • ph_with_text
Examples
# NOT RUN {
fileout <- tempfile(fileext = ".pptx")
doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- ph_with_text(x = doc, type = "title", str = "Un titre")
doc <- ph_with_text(x = doc, type = "ftr", str = "pied de page")
doc <- ph_with_text(x = doc, type = "dt", str = format(Sys.Date()))
doc <- ph_with_text(x = doc, type = "sldNum", str = "slide 1")

doc <- add_slide(doc, layout = "Title Slide", master = "Office Theme")
doc <- ph_with_text(x = doc, type = "subTitle", str = "Un sous titre")
doc <- ph_with_text(x = doc, type = "ctrTitle", str = "Un titre")

print(doc, target = fileout )
# }
Documentation reproduced from package officer, version 0.3.5, License: GPL-3

Community examples

Looks like there are no examples yet.