TextSegment
Overview
TextSegment is a class in Aspose.PDF FOSS for .NET.
A single segment within a TextFragment.
This class declares 3 methods for TextSegment objects in .NET programs.
Available methods include: MyHtmlEncode, TextSegment.
Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: BaselinePosition, Characters, EndCharIndex, Hyperlink, InlineImage, IsTab, and 7 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Text | string | Read/Write | The text of this segment. |
Position | Position? | Read/Write | The position of this segment on the page. |
BaselinePosition | Position? | Read/Write | Gets or sets the baseline position. |
TextState | TextState | Read/Write | The text state (font, size, colour, etc.) for this segment. |
StartCharIndex | int | Read | The starting character index of this segment within the source text run on the page. |
EndCharIndex | int | Read | The ending character index of this segment within the source text run on the page. |
Rectangle | Rectangle? | Read | The bounding rectangle of this segment. |
Characters | CharInfoCollection | Read | Per-character layout information for this segment: one CharInfo per character, in text order, populated when the segment is produced by a text absorber. |
Hyperlink | Hyperlink? | Read/Write | Optional hyperlink associated with this segment. |
InlineImage | Image? | Read/Write | A picture standing in this segment’s place on the line: it takes the picture’s box (FixWidth by FixHeight) on the baseline and raises the line’s ascent to its height when it is taller, and the segment’s text is not drawn. |
IsTab | bool | Read/Write | The segment is a tab: it draws nothing and carries the line on to the next of the paragraph’s tab stops past where the line has got to (RunTabStops), else to the next multiple of RunTabInterval; its text is not drawn. |
TextEditOptions | TextEditOptions | Read/Write | Edit options applied during text replacement / font substitution. |
PhysicalSegment | PhysicalTextSegment | Read | Physical (page-space) view of this segment: exposes its on-page start X via TextState.TextXIndent and per-range advance measurement via MeasureSegment(int, int, bool). |
Methods
| Signature | Description |
|---|---|
TextSegment() | Creates a segment with empty text and a default text state. |
TextSegment(text: string) | Creates a segment with the given text and a default text state. |
MyHtmlEncode(value: string) | HTML-encode a string by replacing &, <, >, ", and ' with their entity references. |