.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

SubDocument.AppendDocumentContent(Stream, DocumentFormat, String, InsertOptions) Method

Appends content from the stream.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v21.1.Core.dll

Declaration

DocumentRange AppendDocumentContent(
    Stream stream,
    DocumentFormat format,
    string sourceUri,
    InsertOptions insertOptions
)

Parameters

Name Type Description
stream Stream

A Stream representing a sequence of bytes interpreted as the content to append.

format DocumentFormat

A DocumentFormat enumeration specifying the format of the data contained in the stream.

sourceUri String

A string representing the URI for the document being appended. Required to import formats with external content such as HTML.

insertOptions InsertOptions

An InsertOptions enumeration value, specifying how destination formatting is applied to inserted content in certain cases.

Returns

Type Description
DocumentRange

A DocumentRange representing a range with the appended content.

Remarks

The AppendDocumentContent method loads the specified stream into the internal document model with the help of the specific importer. The sourceUri parameter is passed to the importer so the importer may use it when required. If the HTML-specific importer is created, the sourceUri is used to find pictures and other external content, such as .css files.

After the stream is imported successfully, the new document model is inserted at the end of the main document.

Specify the insertOptions parameter to define how formatting is applied to the formatted text inserted into a document. Refer to the InsertOptions enumeration description for information on how formatting is applied to the pasted document elements depending on the property value.

The appended text starts with a new paragraph and preserves formatting. It is appended to an existing section and gets all section details (header, footer, page and print layout).

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.

When you pass the DocumentFormat.Undefined value as the format parameter, the inserted content’s format is determined automatically.

See Also