Interface IText
Assembly: IronPPT.dll
Syntax
public interface IText : IContentElement, ITextContentElement, IHasTextStyle
IText is the contract for one styled run of text inside a slide or text box, the unit a developer reads, rewrites, or restyles when editing words on a slide. It is what ISlide.Texts and ITextBox.Texts hand back, so iterating a slide's text works against this contract rather than a concrete class.
The concrete implementor in IronPPT is Text. A developer usually receives an IText from a slide's Texts collection, or adds one with AddText, then edits it in place. Its own members are Append, which joins another IText to this run and returns the result, and Split, which divides the run on a delimiter into a List<IText>. The everyday read-and-edit members come from the inherited ITextContentElement contract: the Text property holds the actual string, Find locates substrings, and Replace swaps text. Per-run formatting (font, bold, color) is reached through the TextStyle inherited from IHasTextStyle.
foreach (IText run in slide.Texts)
run.Replace("DRAFT", "FINAL");
The add text how-to places text on a slide, and the add paragraph example builds runs of text.
Methods
Append(IText)
Declaration
Parameters
| Type |
Name |
Description |
| IText |
text |
|
Returns
Split(String)
Declaration
List<IText> Split(string delimiter)
Parameters
| Type |
Name |
Description |
| System.String |
delimiter |
|
Returns
| Type |
Description |
| System.Collections.Generic.List<IText> |
|