Hi Manivannan,
Thanks for your interest in Aspose.Slides.
You are working with slide’s placeholder and trying to apply fitTextToShape() method on com.aspose.slides.Placeholder class. You can not use this method with slide’s placeholder.
You can use this method with Shapes which contain text.The fitTextToShape() belongs to com.aspose.slides.TextFrame. Please visit this documentation link for Aspose.Slides for java object.
Please use the following code snippet for you kind reference.
Presentation pres = new Presentation();Please let us know if you have any more queries.
Slide slide = pres.getSlides().get(0);
Rectangle rect1 = slide.getShapes().addRectangle(250, 250, 1500, 2000);
rect1.addTextFrame(“”);
TextFrame txtFrame = rect1.getTextFrame();
txtFrame.setText(“This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.This is text.”);
txtFrame.setWrapText(true);
txtFrame.fitTextToShape();
pres.save(“d:\pptx\fitTextToShape.ppt”, SaveFormat.PPT);