TextFragment Class |
Namespace: Aspose.Pdf.Text
The TextFragment type exposes the following members.
Name | Description | |
---|---|---|
![]() | TextFragment |
Initializes new instance of the TextFragment object.
|
![]() | TextFragment(String) |
Creates TextFragment object with single TextSegment object inside.
Specifies text string inside the segment.
|
![]() | TextFragment(TabStops) |
Initializes new instance of the TextFragment object with predefined TabStops positions.
|
![]() | TextFragment(String, TabStops) |
Creates TextFragment object with single TextSegment object inside and predefined TabStops positions.
|
Name | Description | |
---|---|---|
![]() | BaselinePosition |
Gets text position for text, represented with TextFragment object.
The YIndent of the Position structure represents baseline coordinate of the text fragment.
|
![]() | EndNote |
Gets or sets the paragraph end note.(for pdf generation only)
|
![]() | FootNote |
Gets or sets the paragraph foot note.(for pdf generation only)
|
![]() | Form |
Gets form object that contains the TextFragment
|
![]() | HorizontalAlignment |
Gets or sets a horizontal alignment of text fragment.
(Overrides BaseParagraphHorizontalAlignment.) |
![]() | Hyperlink |
Sets the fragment hyperlink
(Overrides BaseParagraphHyperlink.) |
![]() | IsFirstParagraphInColumn |
Gets or sets a bool value that indicates whether this paragraph will be at next column.
Default is false.(for pdf generation)
(Inherited from BaseParagraph.) |
![]() | IsInLineParagraph |
Gets or sets a paragraph is inline.
Default is false.(for pdf generation)
(Inherited from BaseParagraph.) |
![]() | IsInNewPage |
Gets or sets a bool value that force this paragraph generates at new page.
Default is false.(for pdf generation)
(Inherited from BaseParagraph.) |
![]() | IsKeptWithNext |
Gets or sets a bool value that indicates whether current paragraph remains in the same page along with next paragraph.
Default is false.(for pdf generation)
(Inherited from BaseParagraph.) |
![]() | Margin |
Gets or sets a outer margin for paragraph (for pdf generation)
(Inherited from BaseParagraph.) |
![]() | Page |
Gets page that contains the TextFragment
|
![]() ![]() | Position |
Gets or sets text position for text, represented with TextFragment object.
|
![]() | Rectangle |
Gets rectangle of the TextFragment
|
![]() ![]() | Segments |
Gets text segments for current TextFragment.
|
![]() ![]() | Text |
Gets or sets String text object that the TextFragment object represents.
|
![]() ![]() | TextState |
Gets or sets text state for the text that TextFragment object represents.
|
![]() | VerticalAlignment |
Gets or sets a vertical alignment of text fragment.
(Overrides BaseParagraphVerticalAlignment.) |
![]() | WrapLinesCount |
Gets or sets wrap lines count for this paragraph(for pdf generation only)
|
![]() | ZIndex |
Gets or sets a int value that indicates the Z-order of the graph. A graph with larger ZIndex
will be placed over the graph with smaller ZIndex. ZIndex can be negative. Graph with negative
ZIndex will be placed behind the text in the page.
(Inherited from BaseParagraph.) |
Name | Description | |
---|---|---|
![]() | Clone |
Clone the fragment.
(Overrides BaseParagraphClone.) |
![]() | CloneWithSegments |
Clone the fragment with all segments.
|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | IsolateTextSegments |
Gets TextSegment(s) representing specified part of the TextFragment text.
|
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | ToString | (Inherited from Object.) |
Document doc = new Document(docFile); TextFragmentAbsorber absorber = new TextFragmentAbsorber("hello world"); doc.Pages[1].Accept(absorber);
// Open document Document doc = new Document(@"D:\Tests\input.pdf"); // Find font that will be used to change document text font Aspose.Pdf.Txt.Font font = FontRepository.FindFont("Arial"); // Create TextFragmentAbsorber object to find all "hello world" text occurrences TextFragmentAbsorber absorber = new TextFragmentAbsorber("hello world"); // Accept the absorber for first page doc.Pages[1].Accept(absorber); // Change text and font of the first text occurrence absorber.TextFragments[1].Text = "hi world"; absorber.TextFragments[1].TextState.Font = font; // Save document doc.Save(@"D:\Tests\output.pdf");