vcl-dxrichedit-dot-documentserver.md
A document server component.
TdxRichEditDocumentServer = class(
TdxRichEditCustomDocumentServer
)
TdxRichEditDocumentServer is a non-visual component designed to load, process, edit, generate, and export documents without user interaction. Call a constructor for the TdxRichEditDocumentServer class and pass nil (in Delphi) or nullptr/NULL (in C++Builder) as a parameter to create a server to process documents in a console application.
The list below outlines key members of the TdxRichEditDocumentServer class. These members allow you to import, edit, and export documents without user interaction.
CreateNewDocumentCloses the current document and creates a blank document.DocumentProvides access to document content. You can use this property to edit the current document directly – add/remove text, tables, floating shapes, modify formatting, etc.OnContentChangedAllows you to track document content changes.OnDocumentClosingAllows you to respond to document close operations. For example, you can prevent users from closing a document.OnDocumentLoadedNotifies the application of a successful document load operation. A document may contain references to external resources (images, for example) that take a significant amount of time to load. You can handle this event to ensure that the document is loaded completely.
TdxRichEditControl and TdxRichEditDocumentServer components can generate documents based on a template with placeholders (DOCVARIABLE fields).
Tip
You can use the Options.MailMerge.DataSource property to associate the control with a dataset and use it to populate placeholders with numeric values, text, and images.
CreateMailMergeOptions | MailMergeGenerate a set of documents based on a template.OnMailMergeFinished | OnMailMergeGetTargetDocument | OnMailMergeRecordFinished | OnMailMergeRecordStarted | OnMailMergeStartedAllow you to modify template-based document generation.
The Document Server component allows you to import and export documents in the following formats: DOCX, RTF, DOC, HTML, and TXT.
Note
TdxRichEditDocumentServer initially includes support only for the TXT format to reduce the size of a built executable file. To add support for other formats, you need to explicitly include corresponding units in your project.
DocBytes | HtmlText | OpenXmlBytes | RtfText | TextAllow you to specify document content directly in corresponding formats.LoadDocument | LoadDocumentTemplateImport a document from a file or stream in any supported format.SaveDocumentExports the current document to a file or stream in any supported format.
BeginUpdate | EndUpdate | CancelUpdateAllow you to avoid excessive notifications during batch content and setting changes.IsUpdateLockedIdentifies if a batch change operation is underway.OptionsProvides access to all document server settings.
TObject TPersistent TComponent TdxRichEditCustomDocumentServer TdxRichEditDocumentServer
See Also