ParagraphAbsorber Class |
Namespace: Aspose.Pdf.Text
The ParagraphAbsorber type exposes the following members.
Name | Description | |
---|---|---|
![]() | ParagraphAbsorber |
Initializes a new instance of the ParagraphAbsorber that performs search for sections/paragraphs of the document or page.
|
![]() | ParagraphAbsorber(Int32) |
Initializes a new instance of the ParagraphAbsorber that performs search for sections/paragraphs of the document or page.
|
Name | Description | |
---|---|---|
![]() | PageMarkups |
Gets collection of PageMarkup that were absorbed.
|
![]() | SectionsSearchDepth |
Gets or sets value that instructs how many times sequential searches for more fine elements of structure will be performed.
Default search depth is 3.
It means three searches for horizontally divided sections (headers, paragraphs etc) and three searches for vertically divided ones (columns).
|
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | ToString | (Inherited from Object.) |
![]() | Visit(Document) | |
![]() | Visit(Page) |
Performs search on the specified Page.
|
// Open document Document doc = new Document("input.pdf"); // Create ParagraphAbsorber object ParagraphAbsorber absorber = new ParagraphAbsorber(); // Accept the absorber for first page absorber.Visit(doc.Pages[1]); // Get markup object of first page PageMarkup markup = absorber.PageMarkups[0]; // Loop through structure elements of the page text to find first text fragment of each paragraph foreach (MarkupSection section in markup.Sections) { foreach (MarkupParagraph paragraph in section.Paragraphs) { TextFragment fragment = paragraph.Fragments[0]; // Update text properties fragment.TextState.BackgroundColor = Color.LightBlue; } } // Save document doc.Save(GetOutputPath("output.pdf"));