Manage Text Portions in Presentations on Android

Get Position Coordinates of Portion

getCoordinates() method has been added to IPortion and Portion class which allows retrieving the coordinates of the beginning of the portion.

// Instantiate Prseetation class that represents the PPTX
Presentation pres = new Presentation();
try {
    // Reshaping the context of presentation
    IAutoShape shape = (IAutoShape) pres.getSlides().get_Item(0).getShapes().get_Item(0);
    
    ITextFrame textFrame = (ITextFrame) shape.getTextFrame();
    
    for (IParagraph paragraph : textFrame.getParagraphs()) 
    {
        for (IPortion portion : paragraph.getPortions()) 
        {
            Point2D.Float point = portion.getCoordinates();
            System.out.println("X: " + point.x + " Y: " + point.y);
        }
    }
} finally {
    if (pres != null) pres.dispose();
}