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

Free Support Forum - aspose.com

Setting Line Spacing for portions within paragraphs (C# .NET)

We are using Aspose.Slides 19.11.0 for .NET. We have currently a collection that contains a text frame and I would like all items to have a specific line spacing. The SpaceWithin functionality of the paragraph applies only to the paragraph and not to the portion.

Is there a way to achieve line spacing within the lines of a portion?

Thank you in advance!


I have observed your requirements and like to share that text frames display text data of the shape. Internally, a text frame has got collections of paragraphs. Each paragraph has got collection of portions inside it. There are certain textual properties like text italicizing, boldness, underlining, height, font family and color that are available on portion level. On paragraph level there are different properties like bullets, spacing etc. These are set w.r.t their implementation in DOM (Document Object Model) of presentation that PowerPoint understands. We cannot have a paragraph level property used for portion level.

Now, as a workaround for your scenario you may add a paragraph with only one portion inside it. In this way, when you will apply the spacing property on paragraph level, it will be applied to only single portion inside text.

Please also remember that portions inside a paragraph are determined based on any change in any of above mentioned portion related properties. Otherwise, if there is a single formatting for all text inside portion, then a paragraph will have only portion inside it.