Skip to main content

TdxRichEditCustomDocumentServer.LoadDocument(TStream,TdxRichEditDocumentFormat) Method

Loads a document from the specified stream.

Declaration

function LoadDocument(AStream: TStream; ADocumentFormat: TdxRichEditDocumentFormat): Boolean; overload;

Parameters

Name Type Description
AStream TStream

Contains a source document.

ADocumentFormat TdxRichEditDocumentFormat

A document format.

Returns

Type Description
Boolean

The function returns True if the specified document is successfully loaded; otherwise, False.

Remarks

If the ADocumentFormat parameter accepts the TdxRichEditDocumentFormat.Undefined value, the LoadDocument function iterates through all supported document formats to find the best possible match.

A successful LoadDocument function call updates the Options.DocumentSaveOptions.CurrentFileName and Options.DocumentSaveOptions.CurrentFormat properties and raises the OnDocumentLoaded event.

Note

The document server component has built-in support only for the plain text format to avoid excessive dependencies. Refer to the following topic for information on how to enable RTF, DOC, DOCX, and HTML formats: Document Server: Document Management.

A LoadDocument function call cannot import a document if its format is disabled.

See Also