Free Support Forum - aspose.com

TextAutofit property is not able to shrink the text to avoid overflow (C# .NET)

I am generating report from ppt file by using Aspose.Slides 18.9 version and 19.6 version. I am facing issue of text overflow into text box shape. I have selected Shrink text on overflow option for text box shape into our ppt file.

When i open generated report, i am facing issue of text overflow. But when i edit anything into text box shape, automatically effect of shrink text on overflow get affected.
Can you suggest what could be issue?
I have attached snapshot for your reference.
template.PNG (22.2 KB)

@siriussynoptek,

I have observed your requirements and like to share that for any shape having a TextFrame inside it to hold text has provision to set TextFrame AutofitType property which allow you adjust the text with in shape or extend the shape with respect to text inside the shape. Please check TextAutofitType enumeration for your kind reference. The following sample code will be helpful to you to adjust the text font height such that it gets fit inside the shape.

			//Change font size w.r.t shape size
			contenuShape.TextFrame.TextFrameFormat.AutofitType = TextAutofitType.Normal;

I hope the shared elaboration will be helpful.

Hello Team,

Thanks for the response.
We have already implement this as you have mention but not solved this issue. one more think this issue is generate randomly. sometimes the text is shrink to text properly and some times is not shrink. Please find the attached screenshots.so whats the problem ? we have already set the property in every slide. Do we need to set another property for this ?
template.PNG (22.2 KB)
topic.PNG (15.2 KB)

@siriussynoptek,

I have observed the images shared. The suggested option should work on your end. As you said, you are still facing issue on your end. In this case please share the working sample code along with source presentation and generated output having issue with us. We will be able to proceed further on our end on provision of requested information.

PS: I am assuming that you are reproducing the issue using Aspose.Slides for .NET 20.1. If not then please first try using the suggested version.

Hello Support Team,

We have try and implement 20.1 version but not solved the issue.
as i have already said these issue has occurs randomly. sometimes the text is shrink and sometimes is not shrinking. so whats the issue?
can you please look into this ?

@siriussynoptek,

I have observed your comments. As requested earlier please provide the following information. We may not be able to tell the cause of issue happening randomly. If it were an API issue, it should have been occurring always. However, I still request you to please provide following information.