How to Export Embedded Images in HTML in UWP DOCX Editor
30 Aug 20261 minute to read
This page explains how to export the inserted image as an Embedded image in HTML in Syncfusion® UWP SfRichTextBoxAdv.
SfRichTextBoxAdv lets you specify HTML export settings. By using the ImageNodeVisited event of the HtmlImportExportSettings instance, you can retrieve or set the image stream and image source. When you set the image source to an empty string, the inserted picture is exported as an embedded image in the HTML.
The following code example illustrates to export the inserted image as an Embedded image in HTML in the SfRichTextBoxAdv.
// Hooks the event handler for ImageNodeVisited event.
richTextBoxAdv.HtmlImportExportSettings.ImageNodeVisited += HtmlImportExportSettings_ImageNodeVisited;
/// <summary>
/// Handles the ImageNodeVisited event of the richTextBoxAdv control.
/// </summary>
/// <param name="obj">The source of the event.</param>
/// <param name="args">The <see cref="ImageNodeVisitedEventArgs"/> instance containing the event data.</param>
private void HtmlImportExportSettings_ImageNodeVisited(object obj, Syncfusion.UI.Xaml.RichTextBoxAdv.ImageNodeVisitedEventArgs args)
{
if (args.IsSaving)
{
args.Source = string.Empty;
}
}
// Unhooks the event handler for ImageNodeVisited event.
richTextBoxAdv.HtmlImportExportSettings.ImageNodeVisited -= HtmlImportExportSettings_ImageNodeVisited;