Chau362
2018-08-14 14:15:43 UTC
I am using XSLF to populate a given PowerPoint document (template) with
values from a Hashmap. Inside the PowerPoint I have one slide with
predefined textShapes. Every textShape has one or more textParagraphs. In
order to fill the template with my own values, I loop over the textShape and
textParagraphs and search for a placeholder in the form "< keyword >"
(without spaces). Whenever I find a placeholer, I want to insert new
paragraphs in form of a bullet point after the position of the placeholder.
However if I try to insert a new paragraph at a specific position they only
appear at the end of the textShape. I use the placeholder to collect the
necessary information about the formatting (fontColor, fontSize, fontFamily
etc.)
The placeholder should not be in the final presentation slide, which is why
I tried to replace/delete it. However whenever I try to replace or remove
the placeholder the presentation still looks the same. So basically my
questions are:
1. How can I remove a specified textParagraph from a textShape?
2. Is it possible to create a textParagraph at a specified position in a
textShape?
I tried
((XSLFTextShape) correctShape).getTextParagraphs().remove(paragraphNumber);
to remove and
((XSLFTextShape) correctShape).getTextParagraphs().add(paragraphNumber,
newParagraph);
to insert, but neither worked.
Thanks in advance!
--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
values from a Hashmap. Inside the PowerPoint I have one slide with
predefined textShapes. Every textShape has one or more textParagraphs. In
order to fill the template with my own values, I loop over the textShape and
textParagraphs and search for a placeholder in the form "< keyword >"
(without spaces). Whenever I find a placeholer, I want to insert new
paragraphs in form of a bullet point after the position of the placeholder.
However if I try to insert a new paragraph at a specific position they only
appear at the end of the textShape. I use the placeholder to collect the
necessary information about the formatting (fontColor, fontSize, fontFamily
etc.)
The placeholder should not be in the final presentation slide, which is why
I tried to replace/delete it. However whenever I try to replace or remove
the placeholder the presentation still looks the same. So basically my
questions are:
1. How can I remove a specified textParagraph from a textShape?
2. Is it possible to create a textParagraph at a specified position in a
textShape?
I tried
((XSLFTextShape) correctShape).getTextParagraphs().remove(paragraphNumber);
to remove and
((XSLFTextShape) correctShape).getTextParagraphs().add(paragraphNumber,
newParagraph);
to insert, but neither worked.
Thanks in advance!
--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org