I want to fetch details like (X,Y,Height,Width,Color, etc) recursively from one text placeholder’s text which is encapsulated in “{{ }}” curly bracket.
For example in below zip there is one screenshot of a layout’s placeholder “{{ client name }} and {{dynamic field}}”. I want to store styling details separately for “{{client name}}” and a “{{dynamic field}}” variable data in array of object. I want X, width, colour of a “{{dynamic field}}” as Y will be same as placeholder’s Y position but the X position will be different.
Please let me know is this possible with aspose slide java?
@saquibs,
The text parser has to be your own component for the text analysis. It doesn’t depend on Aspose.Slides library.
Text portion size, position, and color can be obtained as below:
// shape is IAutoShape here
// get the first paragraph, for example
IParagraph paragraph = shape.getTextFrame().getParagraphs().get_Item(0);
// get the first text portion, for example
IPortion portion = paragraph.getPortions().get_Item(0);
Rectangle2D portionRectangle = portion.getRect();
Color portionColor = portion.getPortionFormat().getEffective().getFillFormat().getSolidFillColor();
Thanks, I did that but there is a case where I am having a single paragraph and single portion now I have to get X and Width of “{{dynamic field}}” word.