I found an issue with a shape not keeping its “Shrink text on overflow” autofit property after paragraphs are added to it.
Please see the attached example AutofitTest.pptx file. There is a shape in it with Autofit set to “Shrink text on overflow”.
In the code below, I am adding a few paragraphs to the shape. At the end, the shape still shows the Autofit set to “Shrink text on overflow”, however, the text does not shrink.
FileInputStream fileInput = new FileInputStream( “c:/TestAutofit.pptx”);
Presentation pres = new Presentation( fileInput );
ISlide slide = pres.getSlides().get_Item(0);
IAutoShape shape = (IAutoShape) slide.findShapeByAltText(“autofitTest”);
System.out.println("Shape autofit: " + shape.getTextFrame().getTextFrameFormat().getAutofitType() );
String longString = “This is a long paragraph. This is a long paragraph. This is a long paragraph. This is a long paragraph. This is a long paragraph.”;
for( int i = 0; i<4; i++ )
para = new Paragraph();
System.out.println("Paragraphs inserted: " + new Date());
FileOutputStream fileOutput = new FileOutputStream( “c:/output.pptx”);
pres.save( fileOutput, SaveFormat.Pptx );
Please let me know if this can be fixed.