Hello
I try to find coordinate of text presente in a slide.
I use this code to find coordinate
//Instatiate PresentationEx class that represents a PPTX file
Presentation pptxPresentation = new Presentation(new FileInputStream(args[0]));
//Get an Array of TextFrameEx objects from the first slide
ITextFrame[] textFramesSlideOne = SlideUtil.getAllTextBoxes(pptxPresentation.getSlides().get_Item(0));
//Loop through the Array of TextFrames
for (int i = 0; i < textFramesSlideOne.length; i++)
{
//Loop through paragraphs in current TextFrame
for(IParagraph para : textFramesSlideOne[i].getParagraphs())
{
//Loop through portions in the current Paragraph
for(IPortion port : para.getPortions())
{
//Display text in the current portion
System.out.println(port.getText());
}
System.out.println("rectangle : " + para.getRect());
}
}
The coordinate of the text is not link to the zero of slide.
image.png (63.2 KB)
The y and x value doesn’t have the zero on the bottom left of the silde,
5.zip (211.7 KB)
5-locate.pdf (232.3 KB)
Can give me the method to caculate the coord of text form the bottom left of the slide
Best regards
Fabien