I am working on reporting requirement, where in slides are generated
dynamically from a simple template of size 16:9, template has two places
holders, a table with multiple rows and a fixed size text box (6.2" x
9.75"), the size of the text box should not exceed its predefined size, its
sized to align perfectly into the slide.
The text that goes into text box is keyed in by user in application via
Reach Text Editor - RTE field, supports standard RTE styling like BOLD,
Italic, Underline, Strike through, order un-ordered list and H1 to H3
headers with normal format, there is no limit on the text length.
User has an option to download the content as PPT report, report has to
retain the format/styling user has used. Now coming to problem, when the
text keyed in by user runs longer than text that can fit into text box on
the slide text overflows, when there is text overflow a new slide has to be
created with a text box for overflow text. No shrink of text on overflow.
I checked XSLFTextShape.getTextHeight() to get text height, the endpoint
returns text height based on the font style etc. As text keyed-in is via
RTE, styling can vary, figuring out what text can fit into text box
considering the varying text font ex: a lengthy text with normal styling can
fit into text box, but when user apply H1 Style or add an ordered list on
same text will result in overflow. User is free to apply all supporting
styling in RTE. Problem is I am not able to figure out the point of text
Is there a possibility to programmatically via poi to know the point of
overflow and act accordingly..?