We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Leading paragraph break included as part of Portion.Text in PPT file

In Aspose.Slides v14.2.0, if the text in a TextFrame begins with a paragraph break (e.g. an empty line before the first bullet point), that paragraph break is included as the first character in the first portion of the first Paragraph of the TextFrame, instead of being handled as an empty Paragraph.



As far as I can tell, this only happens when the file is a PPT file (like the one attached), rather than a PPTX.

Also, please note that, just like in the example I posted in a different thread (Corruption when saving a PPT file with Aspose.Slides 14.2.0), simply opening and resaving this PPT file results in the formatting of the slide becoming corrupt (the width of the text area with the bullets is changed).

If I try to work around the issue by checking for a leading paragraph mark, removing it and inserting an empty paragraph, the resulting file is considered to be corrupt by PowerPoint 2013.

Hi Daniel,

I have worked with the presentation file shared by you and have been able to observe the formatting lost issue in generated presentation. An issue with ID SLIDESNET-35328 has been created in our issue tracking system to investigate and resolve the formatting issue.


I have observed your following comments. Can you please share sample code to reproduce the issue on our end along with some further details of the issue.

"In Aspose.Slides v14.2.0, if the text in a TextFrame begins with a paragraph break (e.g. an empty line before the first bullet point), that paragraph break is included as the first character in the first portion of the first Paragraph of the TextFrame, instead of being handled as an empty Paragraph. "

This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

The following code should be enough:





Presentation presentation = new Presentation(“C:\TEMP\AsposePowerPointBugs\ParagraphMarks.ppt”);

Debug.Assert(!((AutoShape)presentation.Slides[0].Shapes[1]).TextFrame.Paragraphs[0].Portions[0].Text.StartsWith("\r"));

To make things worse, if I try to assign a string that contains a carriage return to that portion’s .Text property, I get an exception saying: “Can’t assign string which contains paragraph break character”

Try the following:

Presentation presentation = new Presentation("C:\\TEMP\\AsposePowerPointBugs\\ParagraphMarks.ppt");
IPortion p = ((AutoShape)presentation.Slides[0].Shapes[1]).TextFrame.Paragraphs[0].Portions[0];
string s = p.Text;
p.Text = s;

Hi Daniel,


Thanks for sharing the details with us.

I have worked with the presentation file shared along with sample code used. I have been able to observe the issue specified. An issue with ID SLIDESNET-35333 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

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


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