Rotation of Shapes don't work with Slides.Net 14.2+

Well, I’m a bit frustrated.


After migrating a huge amount of code to the Unified API I’ve discovered Shape rotation is broken.
The following 3 simple lines from your documentation (slightly modified the shape size) are not working with version 14.2.0 and 14.3.0

ISlide sld = pptx.Slides[0];
//Add autoshape of rectangle type
IShape shp = sld.Shapes.AddAutoShape(ShapeType.Rectangle, 50, 150, 500, 50);
//Rotate the shape to 90 degree
shp.Rotation = 90;

After setting the rotation value to the shape the debugger tells me Rotaition is NaN and the saved pptx also shows the sphape unrotated.

I have to repeat myself, that I’m very frustrated at the moment. Because your PDF library doesn’t work as expected we have to use the Slides components to create PDF documents but now we can’t even use the Slides component anymore because of this bug.

We need a fix very urgent!

Hi Daniel,

Thank you for sharing the details.

I am able to reproduce your mentioned issue after an initial test. An issue has been registered in our issue tracking system with issue id: SLIDESNET-35376. You will be notified via this forum thread once the issue gets resolved.

Thanks & Regards,

I assume fixing this issue and releasing a new version may take some time. But we need a solution today.


Can you please contact your development team and ask them if there is any workaround we can use to set the rotation in another way. Maybe by reflection or by setting other properties.

This is a show stopper for our software and we have to fix that issue shortly!

Hi Daniel,

I have shared your concerns with the development team and asked them to suggest any workaround (if possible) as per the issue you are facing. As soon as I get a feedback, I will update you via this forum thread.

Thanks & Regards,

Hi Daniel,

Please try the following workaround at your end and let us know if it works fine for you.

Presentation pptx = new Presentation();
ISlide sld = pptx.Slides[0];

//Add autoshape of rectangle type
IShape shp = sld.Shapes.AddAutoShape(ShapeType.Rectangle, 50, 150, 500, 50);

float rotation = 90;

// This part is necessary only if there is a chance for rotation to go beyond the[0; 360] range.
if (rotation < 0)
    rotation += (float)(360 * Math.Floor((-rotation) / 360) * 360);

rotation %= 360;

IShapeFrame oldFrame = shp.Frame;

shp.Frame = new ShapeFrame(oldFrame.X, oldFrame.Y, oldFrame.Width, oldFrame.Height, oldFrame.FlipH, oldFrame.FlipV, rotation);

pptx.Save("c:\data\rotation.pptx", Aspose.Slides.Export.SaveFormat.Pptx);

Thanks & Regards,

It’s working. Thanks!

Hi Daniel,

Thank you for the confirmation.

We are glad to know that the workaround works fine for you. Please feel free to contact support in case you need any further assistance.

Thanks & Regards,

The issues you have found earlier (filed as SLIDESNET-35376) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.