Document Model
- 3 minutes to read
Overview
A document model defines the logical structure of a document, which reflects its logical organization and hierarchically groups the logical entities in a document. It is illustrated in the following scheme.
Main Elements
A document is not monolithic; it is built out of multiple parts. Relationships between parts are themselves stored in parts. The main entities of the document model are described below.
Sub-document(s)
Internally, the root of the document model is represented by a sub-document object - the main sub-document. It delivers the basic document functionality that is common for the header, footer and the main document body.
A sub-document allows you to manipulate the text, tables, lists, fields, paragraphs, bookmarks.
Section(s)
A document (sub-document) can contain logical sections. Each section defines its own page settings, such as paper kind, page orientation and its margins.
A section allows you to manipulate footers, headers, page properties.
Paragraph(s)
A sub-document contains paragraphs - text blocks that expose own paragraph-specific formatting settings (such as alignment, spacing and indentation).
Character(s)
A paragraph internally consists of runs - groups of characters with uniform formatting.
The document model also includes entities that do not comprise the hierarchy, such as lists, tables and styles.
Numbered and Bulleted Lists
The numbered and bulleted lists are represented by specific collections of paragraphs, which expose own list-specific formatting settings.
Styles
Styles can be of the following types - a paragraph style, a character style and a table style.
Tables
Tables are specific structures that are based on paragraphs. Each table cell is actually a paragraph. Therefore, you should operate with a corresponding paragraph for changing cell content. Cell formatting and paragraph formatting are superimposed, so you are advised to specify cell formatting explicitly to get the desired result.
Default Tab Width
Specifies the default width of tabulation in the whole document. This width can be redefined in paragraphs.
Page Back Color
Specifies the background color for all pages in the document.
Different Odd And Even Pages
An option specifying which footers/headers to use for a section.
Client API
The following client-side API is available. It provides information about the current settings of the main document model elements and allows you to modify certain element settings.
Properties
The properties listed below can be accessed through the ASPxClientRichEdit.document property in the following notation:
clientRichEditName.document.propertyName
Property Name | Link | Description |
---|---|---|
activeSubDocument | RichEditDocument.activeSubDocument | Returns the active sub-document. |
sectionsInfo | RichEditDocument.sectionsInfo | Returns information about sections in the document. |
characterStylesInfo | RichEditDocument.characterStylesInfo | Returns information about character styles in the document. |
paragraphStylesInfo | RichEditDocument.paragraphStylesInfo | Returns information about paragraph styles in the document. |
abstractNumberingListsInfo | RichEditDocument.abstractNumberingListsInfo | Returns information about numbered paragraphs in the document. |
tableStylesInfo | RichEditDocument.tableStylesInfo | Returns information about table styles in the document. |
Commands
The commands listed below can be accessed through the ASPxClientRichEdit.commands property and be executed in the following notation:
clientRichEditName.commands.commandName.execute(parameter_if_any)
Command Name | Link | Description |
---|---|---|
changePageColor | RichEditCommands.changePageColor | Gets a command to set the background color of all pages contained in the document. |
setDifferentOddAndEvenPagesHeaderFooter | RichEditCommands.setDifferentOddAndEvenPagesHeaderFooter | Gets a command to enable (or disable if it is enabled) a different page header and footer for odd and even pages of the current section. |
changeTabs | RichEditCommands.changeTabs | Gets a command to change the default tab stop value of a document and apply custom tab settings to the selected paragraphs.Sets only the defaultTabStop parameter. |