List the available placeholders in a slide or a given layout

list_placeholders(
  pptx,
  index = NULL,
  layout = NULL,
  units = c("in", "cm"),
  keep_all = FALSE,
  error_call = current_env()
)

Arguments

pptx

A Powerpoint wrapped in a <pptx_container> object. see load_pptx()

index

Slide index

layout

the name of the layout in the powerpoint. Overridden if index is provided

units

"in" or "cm", what units should be used for the values presented (offsets, dimensions)

keep_all

Keep all the placeholders (TRUE), or only the ons with a node (FALSE)

error_call

The execution environment of a currently running function, e.g. caller_env(). The function will be mentioned in error messages as the source of the error. See the call argument of abort() for more information.

Examples


pptx <- example_pptx()

# what are the available placeholders on the slides
list_placeholders(pptx, layout = "Two Content")
#>   ph_label                   type   `x (in)`      `y (in)`      
#> 
#> ── From layout "Two Content" ───────────────────────────────────────────────────
#> 1 Content Placeholder 2      body   [0.50 - 4.92] [1.75 - 6.70] 
#> 2 Content Placeholder 3      body   [5.08 - 9.50] [1.75 - 6.70] 
#> 3 Date Placeholder 4         dt     [0.50 - 2.83] [6.95 - 7.35] 
#> 4 Footer Placeholder 5       ftr    [3.42 - 6.58] [6.95 - 7.35] 
#> 5 Slide Number Placeholder 6 sldNum [7.17 - 9.50] [6.95 - 7.35] 
#> 6 Title 1                    title  [0.50 - 9.50] [0.30 - 1.55] 
list_placeholders(pptx, index = 2)
#>   ph_label                   type   `x (in)`      `y (in)`      
#> 
#> ── From slide ──────────────────────────────────────────────────────────────────
#> 1 my new left label          body   [0.50 - 4.92] [1.75 - 6.70] 
#> 2 my new right label         body   [5.08 - 9.50] [1.75 - 6.70] 
#> 
#> ── From layout "Two Content" ───────────────────────────────────────────────────
#> 3 Date Placeholder 4         dt     [0.50 - 2.83] [6.95 - 7.35] 
#> 4 Footer Placeholder 5       ftr    [3.42 - 6.58] [6.95 - 7.35] 
#> 5 Slide Number Placeholder 6 sldNum [7.17 - 9.50] [6.95 - 7.35] 
#> 6 Title 1                    title  [0.50 - 9.50] [0.30 - 1.55]