aspnet-117599-components-rich-text-editor-document-document-model-text-content-text-buffer.md
The basis of a sub-document is its actual text content. This content is stored within a sub-document’s text buffer that can be accessed on the client using the SubDocument.text property. This is a separate logical stream of text containing all textual parts in a sub-document, such as paragraphs, lists, tables, and etc. All sub-document parts are bound to certain positions within the text buffer. The text buffer uses a plain one-dimensional coordinate system to identify character locations in the buffer. A coordinate position is based on a character’s position from the first character in the buffer.
All entities of sub-document parts have their own symbol marks. In particular, these are:
The text buffer contains contiguous pieces of text (text characters and specific symbol marks) with no additional text markup. Some examples:
If RichEdit’s main sub-document displays a sentence that has two words with different font formatting and ends with a paragraph mark:
If a sub-document contains only an inline picture and a paragraph mark, the text buffer does not contain any real text. It contains just two specific mark symbols - one to mark the inline picture and another - to mark the paragraph end. The text buffer’s length is 2.
The RichEdit has two modes of displaying formatting marks on the screen.
Hide formatting marks
Show formatting marks
The display mode of formatting marks can be changed by pressing the “Crtl+Shift+8” key combination.
Client commands provide a set of methods that can be used to insert and delete text and special symbols in the following notation:
clientRichEditName.commands.showHiddenSymbols.execute(parameter_if_any)
Use the RichEditCommands.showHiddenSymbols command in the following notation, to programmatically toggle the visibility of formatting marks:
clientRichEditName.commands.showHiddenSymbols.execute(parameter_if_any)
A sub-document object (SubDocument) exposes the following text buffer related properties, which can be used in the notation given below:
clientRichEditName.document.activeSubDocument.propertyName
| Property Name | Link | Description |
|---|---|---|
| text | SubDocument.text | Gets the document’s text. |
| length | SubDocument.length | Gets the length of the sub-document. |