Ciao,
I'm working on a custom pptx presentation using officer package on R. The truth is that I am porting the code form Reporters.
My question is about the structure of a layout. The starting point is an empty pptx I upload in order to import themes and formatting settings; In particular I do not use
ppt <- read_pptx()
to create the pptx but rather I import it from an existing file:
ppt <- read_pptx("Blank_officer.pptx")
This is how it is the standard slide layout
The problem is that I dont't know how to fill fields at this point. This is what I want to reach:
I tried using the following code:
ppt <- read_pptx( ROOT_PATH( "template/Blank_officer.pptx" ) )
ppt <- ppt <- add_slide( ppt, "Internal Slide - 1 Column Text", master = "Blank" )
ppt <- ph_with_text(x = ppt, str = "A Title", type = "title")
ppt <- ph_with_text(ppt, "Bullet text 4", type = "body", index = 4)
ppt <- ph_with_text(ppt, "Bullet text 11", type = "body", index = 11)
ppt <- ph_with_text(ppt, "\nBullet text 11.2", type = "body", index = 11)
ppt <- ph_with_text(ppt, 2, type = "sldNum")
print( ppt, target = "officerTest.pptx" )
and I get the following result:
It seems fine but the truth is that I am choosing index argument by a "try-and-fail" approach, i.e. by random choosing the value and see what happens.
Can you explain me the how the index argument works?
Is there a command that shows me, for a given slide layout, which are the index I can use to write in text box?
In alternative:
I was wondering if there exists a "Tab"-like function, i.e. a funtion that let me navigate in text box like addParagraph function in Reporters package.
Thanks for your help,
Ciao