Setting Width Property on Aspose.Slides.IShape Is Not Taking New Value

Hi, I am trying to resize shapes in my PowerPoint files, but sometimes it does not resize properly. I am using the documentation found here: Re-sizing Shapes on Slide|Aspose.Slides Documentation

In my example attached, you can see the outputs. You can see the second shape in the file 000000016 that the size does not get set. Instead of going down, it goes up in value.
For file 000000041 it works properly.

Please advise
PPTScale2.zip (419.2 KB)

@ccuster68,
Thank you for contacting support.

This occurs because the second shape has the “Resize shape to fit text” option. You should try resetting this option for the shapes and then resize them. The code example below shows you how to do this:

if (shape is IAutoShape autoShape)
{
    autoShape.TextFrame.TextFrameFormat.AutofitType = TextAutofitType.None;
}

Documents: Manage Autofit Settings
API Reference: ITextFrameFormat.AutofitType Property | TextAutofitType Enumeration

Thank you for this information. This is what I needed.

@ccuster68,
We are glad to know that the issue is resolved on your end. Thank you for using Aspose.Slides.