Free Support Forum - aspose.com

PPTX - How to get line width on text box?

How do I get the border properties of a Text Box in a PPTX file? The property Aspose.Slides.ShapeEx.LineFormat.Width says "NaN". I need to determine lineWidth:

foreach (AS.Pptx.SlideEx currSlide in _presentationX.Slides)
{
for (int i = currSlide.Shapes.Count - 1; i >= 0; i--)
{
currShape = currSlide.Shapes[i];
int lineWidth = currShape...?
}
}

Thanks,

Jeff


Dear Jeff,

I feel you have done right to extract the line width of the text frame. I have used the following code snippet to extract the line width of the shape in PPTX using Aspose.Slides for .NET 4.3.0. For your kind reference, I have also attached the presentation file as well.

//Instantiate PrseetationEx class that represents the PPTX

PresentationEx pres = new PresentationEx("d:\\RectShp1.pptx");

//Get the first slide

SlideEx sld = pres.Slides[0];

ShapeEx shx = sld.Shapes[0];

double dWidth = shx.LineFormat.Width;

Thanks and Regards,

Mudassir,

Thank you. Your sample attachment PPTX works as expected.

By inspecting the XML of my PPTX, and by experimenting, I think I found the trouble: my shapes do not have a specific line width defined, but seem to get their width from some kind of default or theme. If I manually change the line width to a different value, then LineFormat.Width shows the new value correctly. However, I am unable to find where this line width is defined.

Do you know how to get the line width of a shape when the width is from a default or from a theme? I have attached a file for reference.

Thanks,

Jeff

Dear Jeff,

I have investigated the presentation in detail and have been able to reproduce the issue specified by you. This issue need to be investigated further by our development team and for that an issue with ID 20896 has been created in our issue tracking system to resolve the problem. This thread has also been linked with the issue, so that you may be automatically notified once the issue is resolved.

We are sorry for your inconvenience,

Dear Jeff,

I like to share that our development team has initially investigated the issue shared by you and expected ETA for the issue is mid of March. I really appreciate your patience for that.

Thanks and Regards,

That's great - thanks for the update.

Jeff

Any update on ETA yet?

Thanks,

Jeff Montgomery

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


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

Hi,

I have re-tested this issue with Aspose.Slides version 5.2.0.0 and I am still seeing the problem. See the attached test program, which opens a sample document in both 2003 and 2007 format. If you view the 2007 version file, the shapes obviously have red lines around them. However, Aspose.Slides still reports the line Width=NaN.

Jeff Montgomery

Hi Jeff,

I have modified the project code shared by you and things are working fine. Actually, a new mechanism for line properties has been added in Aspose.Slides for .NET 5.2.0. Hopefully, things will work fine now.

Thanks and Regards,

Mudassir,

Thanks, that's better. However, when I build and run the project the new method shows a line width of "3" but the actual value is 2 for both source files.

Jeff Montgomery

Clarification: what I meant to say is the new method displays the correct value (2) for PPT, but is off by one unit (3) for PPTX.

Hi Jeff,

Thanks for the clarification. I have been able to observe this minor inconsistency. I have re-opened the issue 20896 for further investigation. We will update you further once the issue is resolved.

Thanks and Regards,