This sample demonstrates extracting text blocks along with their spatial coordinates from a PowerPoint presentation using GroupDocs.Parser.
Java
// Load your PPTX file with the Parser API
try (Parser parser = new Parser("input.pptx"))
{
// Get all rectangular text zones
IEnumerable<PageTextArea> areas = parser.GetTextAreas();
// Exit if this feature is not supported
if (areas == null)
{
return;
}
// Loop through text areas by page
for (PageTextArea a : areas)
{
// Process each text block with its page number and bounding rectangle
System.out.println(String.format("Page: %d, R: %s, Text: %s", a.getPage().getIndex(), a.getRectangle(), a.getText()));
}
}