Shape height and width issue

Hi, I have a question about setting the size properties of shapes in Aspose.Words. Is that something you can help with?

I’m struggling with setting the size properties on shapes. I assumed the property values are points, but the point values I set are not the ones I see when I look at the shape objects in the Word document.

For example, if I set “shape.Width = 100;”, the actual width of the shape in points is 573,75 pt

I assume I’m missing something obvious here about the metric/scale that I need to use to control size properties…?

Just to ensure we are looking at the same thing:

I set the shape.width (of a textbox) to 100 in aspose.words code.

Then I open the generated Word document, right click on the textbox shape and select “Format text box”.

In that dialog box I then see Width (absolute) set to 573,75

Is that the issue you could not find to be shared?

should it be the case that the width (and height) value set in code is exactly the same as what we see in the Word document?

This message was posted using Email2Forum by Tahir Manzoor.

I am working on setting size properties on shapes (textbox, in this case), and have encountered behaviour I don’t understand.

In code, I set the shape size properties like this:

shape.Width = 100;

shape.Height = 20;

I assumed that the property values refer to points.

But when I open the Word document and look at the shape properties, I see that Width is set to "

“573,75 pt” and Height is set to “40,5 pt”

I assume there’s something obvious I’m missing here, probably to do with the metric or scale that is used for setting these property values programmatically. I would be really grateful if someone could explain!

Some additional information: the shapes I am adding are added as members of a GroupShape. This seems to be significant, as I just discovered the following in the ShapeBase definition:

“For shapes in a group, the value is in the coordinate space and units of the
parent group.”

This may explain why I’m seeing the behaviour described in this query - but it would still be useful to get some more explicit guidance and examples of how to then work with setting the size of shapes that are part of a GroupShape.

Hi Steven,

Thanks for your inquiry. Yes, you are facing the different value of Shape’s height/width because shapes are in a Group.

‘For shapes in a group, the value is in the coordinate space and units of the parent group.’

We are in communication with our development team about your query and will get back to you as soon as possible.

Hi Steven,

Thanks for your patience. Unfortunately, Aspose.Words does not support the requested feature at the moment. However, I have logged this feature request as WORDSNET-10682 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-10682) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as WORDSNET-10557) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.