Content service
Load, inspect, transform and export HTML through the awaited Content facade. Use it when your application owns document persistence, imports or generated messages.
The facade is available as editor.Content; its interface can be replaced by an application implementation.

Use it in your application
The editor must be attached to a visible window before readiness can complete. Fresh exports apply a pending Source draft or report an apply failure; they do not silently return an older rendered document.
All examples assume an editor named editor, already attached to a visible window, and an awaited editor.Ready. Keep operations asynchronous instead of blocking the UI thread.
string body = await editor.Content.GetBodyHtmlAsync();
string document = await editor.Content.GetDocumentHtmlAsync();Members
These signatures come from the delivered 1.0.2 assemblies and XML documentation. Cancellation tokens can be supplied to awaited operations. Follow the source-specific notes above when adapting a WPF integration.
| Member | Signature |
|---|---|
ChangeElementIdAsync | Task<EditorSnapshot> ChangeElementIdAsync(string oldId, string newId, CancellationToken cancellationToken) |
ClearContentAsync | Task<EditorSnapshot> ClearContentAsync(CancellationToken cancellationToken) |
ElementExistsAsync | Task<bool> ElementExistsAsync(string elementId, CancellationToken cancellationToken) |
EmbedLocalImagesAsBase64Async | Task EmbedLocalImagesAsBase64Async(CancellationToken cancellationToken) |
GetAllImageSourcesAsync | Task<string[]> GetAllImageSourcesAsync(CancellationToken cancellationToken) |
GetAllLinkHrefsAsync | Task<string[]> GetAllLinkHrefsAsync(CancellationToken cancellationToken) |
GetAttributeValueOfAnElementAsync | Task<string> GetAttributeValueOfAnElementAsync(string elementId, string attributeName, CancellationToken cancellationToken) |
GetBodyClassNameAsync | Task<string> GetBodyClassNameAsync(CancellationToken cancellationToken) |
GetBodyHtmlAsync | Task<string> GetBodyHtmlAsync(CancellationToken cancellationToken) |
GetBodyHtmlAsync | Task<string> GetBodyHtmlAsync(bool getInXhtml, CancellationToken cancellationToken) |
GetBodyStyleAsync | Task<string> GetBodyStyleAsync(CancellationToken cancellationToken) |
GetBodyTextAsync | Task<string> GetBodyTextAsync(CancellationToken cancellationToken) |
GetDocumentHtmlAsync | Task<string> GetDocumentHtmlAsync(CancellationToken cancellationToken) |
GetDocumentHtmlAsync | Task<string> GetDocumentHtmlAsync(bool getInXhtml, CancellationToken cancellationToken) |
GetDocumentXmlAsync | Task<string> GetDocumentXmlAsync(CancellationToken cancellationToken) |
GetEmailMessageWithLocalImagesEmbeddedAsync | Task<MailMessage> GetEmailMessageWithLocalImagesEmbeddedAsync(CancellationToken cancellationToken) |
GetFormattedPlainTextAsync | Task<string> GetFormattedPlainTextAsync(CancellationToken cancellationToken) |
GetInnerHtmlOfAnElementAsync | Task<string> GetInnerHtmlOfAnElementAsync(string elementId, CancellationToken cancellationToken) |
GetOuterHtmlOfAnElementAsync | Task<string> GetOuterHtmlOfAnElementAsync(string elementId, CancellationToken cancellationToken) |
InsertHeadElementAsync | Task<EditorSnapshot> InsertHeadElementAsync(string tagName, string html, CancellationToken cancellationToken) |
InsertHorizontalRuleAsync | Task InsertHorizontalRuleAsync(CancellationToken cancellationToken) |
InsertHtmlAsync | Task InsertHtmlAsync(string html, bool keepSelected, CancellationToken cancellationToken) |
InsertTextAsync | Task InsertTextAsync(string text, CancellationToken cancellationToken) |
ReapplyDefaultBodyStyleAsync | Task ReapplyDefaultBodyStyleAsync(CancellationToken cancellationToken) |
RemoveHtmlElementByIdAsync | Task<EditorSnapshot> RemoveHtmlElementByIdAsync(string id, CancellationToken cancellationToken) |
RemoveHtmlElementFromHeadByTagAsync | Task<EditorSnapshot> RemoveHtmlElementFromHeadByTagAsync(string tagName, CancellationToken cancellationToken) |
SetAttributeValueOfAnElementAsync | Task<EditorSnapshot> SetAttributeValueOfAnElementAsync(string elementId, string attributeName, string value, CancellationToken cancellationToken) |
SetBodyClassNameAsync | Task<EditorSnapshot> SetBodyClassNameAsync(string className, CancellationToken cancellationToken) |
SetBodyHtmlAsync | Task<EditorSnapshot> SetBodyHtmlAsync(string html, CancellationToken cancellationToken) |
SetBodyStyleAsync | Task<EditorSnapshot> SetBodyStyleAsync(string styleValue, CancellationToken cancellationToken) |
SetBodyTextAsync | Task<EditorSnapshot> SetBodyTextAsync(string text, CancellationToken cancellationToken) |
SetDefaultBodyFontFamilyAsync | Task SetDefaultBodyFontFamilyAsync(string fontFamily, CancellationToken cancellationToken) |
SetDefaultBodyFontSizeAsync | Task SetDefaultBodyFontSizeAsync(string cssFontSize, CancellationToken cancellationToken) |
SetDefaultBodyForeColorAsync | Task SetDefaultBodyForeColorAsync(string cssColor, CancellationToken cancellationToken) |
SetDocumentHtmlAsync | Task<EditorSnapshot> SetDocumentHtmlAsync(string html, CancellationToken cancellationToken) |
UpdateInnerHtmlOfAnElementAsync | Task<EditorSnapshot> UpdateInnerHtmlOfAnElementAsync(string elementId, string newHtml, CancellationToken cancellationToken) |
MailMerge | MailMergeService MailMerge { get; } |
TableAuthoringService | TableAuthoringService TableAuthoringService { get; } |