This example demonstrates how RichEditControl's DocumentLayout API can be used to collect information about a currently clicked document element (as well as its parent elements):
Layout API
Depending on the type (text block, image, table cell, textbox, etc.) of a clicked element, the following information can be analyzed:
content, content bounds, position on a page, page bounds, current page index, a number of images/textboxes on a page, common text blocks count, etc.
In this example, different approaches are used to get layout information about a current element:
- Use the DocumentLayout.GetElement and DocumentLayout.GetElement[T] methods;
- Use the LayoutIterator class;
- Use a custom LayoutVisitor descendant.
To get layout information about the current element, set the caret inside a text block or table cell (or select an image) and click the "Analyze a current document layout" button.