Skip to main content

TdxRichEditCustomDocumentServer.HtmlText Property

Specifies document content as a string (in the HTML format).

Declaration

property HtmlText: string read; write;

Property Value

Type Description
string

Document content (as a string in the HTML format).

Remarks

You can use the HtmlText property to import/export document content in the HTML format (ensure that support for the Hypertext Markup Language format is enabled).

Internal Document Model and Import/Export Operations

Important

The TdxRichEditDocumentServer component does not work natively with documents in the HTML format. Instead, the component builds a document model in memory using an internal XML-like format. You can edit the current document directly using API members accessible through the Document property.

The HtmlText property value’s read/write operations export/import document content. You can use the following properties to configure HTML export/import settings:

Options.Export.Html
Provides access to HTML document export settings.
Options.Import.Html
Provides access to HTML document import settings.

HTML Support Considerations and Limitations

HTML import and export routines support only a limited subset of the modern HTML standard; therefore, imported and exported documents may look different compared to corresponding source documents.

Enable Support for HTML Format

Support for the Hypertext markup language format is initially disabled for the TdxRichEditDocumentServer component to avoid excessive dependencies.

Note

If support for the target format of an import/export operation is disabled, an exception occurs.

To enable support for the HTML format in your application, expand the Add Unit to Support menu item, and add all required dependencies at design time or in code.

At Design Time

Right-click a TdxRichEditDocumentServer component, check the HyperText Markup Language (HTML) option, and save your project to add all required dependencies automatically.

VCL Rich Edit Control: Add Supported Document Formats at Design Time

In Delphi Code

Add the dxRichEit.Html unit to the uses clause of the same unit where the TdxRichEditDocumentServer component is placed. If you build the project with runtime packages, add dxRichEditControlHtmlFormatRS~ to the list of runtime packages.

In C++Builder Code

Add the following directives to the same source files where the TdxRichEditDocumentServer component is placed:

  1. #include "dxRichEdit.Html.hpp" (to the target HPP file)
  2. #pragma link "dxRichEdit.Html.hpp" (to the corresponding CPP file)

Other Document Import/Export Options

You can also use the following API members to import/export document content in different supported[1] formats:

DocBytes
Specifies document content as a byte array (in the Microsoft Word® 97 – 2003 binary format).
OpenXmlBytes
Specifies document content as a byte array (in the Office OpenXML format).
RtfText
Specifies document content (as an RTF string).
Text
Specifies document content (as a plain text string).
LoadDocument | LoadDocumentTemplate | SaveDocument
Export/import document content to/from file or stream in any supported format.
Footnotes
  1. Ensure that support for all required document formats is enabled; otherwise, an exception occurs.
    Refer to corresponding API member descriptions for detailed information on support for different document formats.

See Also