TdxRichEditCustomDocumentServer Class
The base class for the document server component.
Declaration
TdxRichEditCustomDocumentServer = class(
TComponent,
IdxRichEditDocumentServer,
IdxBatchUpdatable,
IdxServiceContainer,
IdxServiceProvider,
IdxInternalRichEditDocumentServerOwner
)
Remarks
TdxRichEditDocumentServer is a non-visual component designed to load, process, edit, generate, and export documents without end-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.
Main API Members
The list below outlines key members of the TdxRichEditCustomDocumentServer
class. These members allow you to import, edit, and export documents without end-user interaction.
Document Management APIs
- CreateNewDocument
- Closes the current document and creates a blank document.
- Document
- Provides access to document content. You can use this property to edit the current document directly – add/remove text, tables, floating shapes, modify formatting, etc.
- OnContentChanged
- Allows you to track document content changes.
- OnDocumentClosing
- Allows you to respond to document close operations. For example, you can prevent users from closing a document.
- OnDocumentLoaded
- Notifies 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.
Template-Based Document Generation
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 | MailMerge
- Generate a set of documents based on a template.
- OnMailMergeFinished | OnMailMergeGetTargetDocument | OnMailMergeRecordFinished | OnMailMergeRecordStarted | OnMailMergeStarted
- Allow you to modify template-based document generation.
Document Import and Export
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 | Text
- Allow you to specify document content directly in corresponding formats.
- LoadDocument | LoadDocumentTemplate
- Import a document from a file or stream in any supported format.
- SaveDocument
- Exports the current document to a file or stream in any supported format.
General-Purpose API Members
- BeginUpdate | EndUpdate | CancelUpdate
- Allow you to avoid excessive notifications during batch content and setting changes.
- IsUpdateLocked
- Identifies if a batch change operation is underway.
- Options
- Provides access to all document server settings.
Terminal TdxRichEditCustomDocumentServer Class Descendant
Do not use the TdxRichEditCustomDocumentServer
class directly. Use the TdxRichEditDocumentServer component instead.