Hi,
I try to get the coordinates of an shape.
ShapeEx imageShape = newSlide.findShapeByAltText(SLIDE_CONTENT);
if(imageShape!=null) {
float x= imageShape.getFrame().getX();
float y= imageShape.getFrame().getY();
}
Result is “NaN”, what is my mistake?
Hello Dear,
I have tried to reproduce the issue shared by you and have not been able to identify the issue shared. I have tested the following code snippet using Aspose.Slides for Java 2.4.2 and have not been able reproduce the issue and it in fact returns the correct values. For your kind reference, the source presentation is also attached.
//Accessing the PPTX presentation
PresentationEx pres=new PresentationEx(“D:\Aspose Data\demo_Image.pptx”);//Accessing the slide
SlideEx sl=pres.getSlides().get(0);//Accessing the shape
ShapeEx sh=sl.getShapes ().get (0);float x=sh.getFrame().getX();;// sh.getX();
float y=sh.getFrame().getY();// sh.getY();
Thanks and Regards,