Skip to main content

SubDocument.AppendRtfText(String) Method

Appends formatted text.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.2.Core.dll

NuGet Package: DevExpress.RichEdit.Core

Declaration

DocumentRange AppendRtfText(
    string rtfText
)

Parameters

Name Type Description
rtfText String

A string containing data in RTF format.

Returns

Type Description
DocumentRange

A DocumentRange representing a range with appended content.

Remarks

The AppendRtfText method imports the specified string in RTF format into the internal document model. After the string is successfully imported, the new document model is inserted at the end of the main document.

The RTF string applies its paragraph and character formatting to the destination paragraph of the document to which it is appended. The RTF string is incorporated as a range, not as a section, therefore all section details (header, footer, page and print layout), contained in the RTF string, are lost.

Note

If the AppendRtfText method is called for an empty document (newly created, e.g., by using the CreateNewDocument method), then the specified RTF string is loaded as a new document, applying its header, footer etc.

If the text being inserted contains document styles which are not present in the current document, the styles are copied to the resulting document.

If the document whose content is being inserted contains floating objects, such as pictures or text boxes, they are inserted into the corresponding positions in a newly created range.

The following code snippets (auto-collected from DevExpress Examples) contain references to the AppendRtfText(String) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also