Add hyperlink to a placeholder in the current slide.
ph_hyperlink(x, type = "body", id = 1, id_chr = NULL, ph_label = NULL, href)
an rpptx object
placeholder type
placeholder index (integer) for a duplicated type. This is to be used when a placeholder
type is not unique in the layout of the current slide, e.g. two placeholders with type 'body'. To
add onto the first, use id = 1
and id = 2
for the second one.
Values can be read from slide_summary()
.
deprecated.
label associated to the placeholder. Use column
ph_label
of result returned by slide_summary()
.
If used, type
and id
are ignored.
hyperlink (do not forget http or https prefix)
Other functions for placeholders manipulation:
ph_remove()
,
ph_slidelink()
fileout <- tempfile(fileext = ".pptx")
loc_manual <- ph_location(bg = "red", newlabel = "mytitle")
doc <- read_pptx()
doc <- add_slide(doc, "Title and Content")
doc <- ph_with(x = doc, "Un titre 1", location = loc_manual)
slide_summary(doc) # read column ph_label here
#> type id ph_label offx offy cx cy rotation
#> 1 body c60efcad-5e73-4270-a23e-90ab45dca946 mytitle 1 1 4 3 NA
#> fld_id fld_type text
#> 1 <NA> <NA> Un titre 1
doc <- ph_hyperlink(
x = doc, ph_label = "mytitle",
href = "https://cran.r-project.org"
)
print(doc, target = fileout)