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

Free Support Forum - aspose.com

Aspose Slides - Detecting Text Overflow


Is there a way to detect text overflow within the main content frame of a slide?
For example, I have a TextHolder object and would like to detect when the height of the text is equal to the height of the TextHolder object.

I do not want to enable autofit because we are using a master file that has a fixed font size.

Thank you!

Dear Jennessianna,

Thanks for considering Aspose.Slides for .NET

There is actually no easy way to do it, but there are two ways, the first one is to make a calculated guess about the number of characters that can be placed in a particular text holder, for this, you will have to use System.Drawing.Font or other System.Drawing classes.

The other method is to note down the height of your textholder, then create the textframe having same width as that of a textholder, then set its TextFrame.FitShapeToText property true, now when you add text inside it, it will grow downward, when its height reaches the height of your textholder, stop adding more text. Then move all the text to your textholder and delete the textframe.