We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Wrong texts coordinates in a slide


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("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



I have observed your requirements and suggest you to please try using the sample code on this link with latest Aspose.Slides for Java 20.3 on your end.