Embedded image and not linked

Hi,

Is there a way in the SfRichTextBoxAdv to insert and image but have it embedded into the document and not linked to the source file?

When the editor content is exported (or linked with a string property through MVVM) as HTML the images are linked through the <image src=""/> tag using the full path to the source file, so wonder if there is a way that the image is embedded using data instead of the file path.

Thanks in advance.


5 Replies

KG Kalaivannan Ganesan Syncfusion Team April 19, 2022 02:47 PM UTC

Hi David García,

In SfRichTextBoxAdv control, we have provided an option to specify HTML export settings. Using this event ImageNodeVisitedEvent of the HtmlImportExportSettings instance, you can get or set the image stream and image source. But currently, we have an issue with modifying the image source. we will validate this and update you with further details on 21st April 2022.

As a workaround, we have created a sample application, where the image is inserted as a stream through
InsertPicture(), and when exported as HTML, the image is maintained as the Embedded image which can be downloaded below,

Regards,
Kalaivannan Ganesan


Attachment: RTE_HTML_Export_f45b6d10.zip


DG David García April 19, 2022 04:52 PM UTC

Thank you for the reply back.

The workaround works for now to the purpose I want.



KG Kalaivannan Ganesan Syncfusion Team April 20, 2022 06:34 AM UTC

Hi David García,

We are glad to hear the shared workaround sample has fulfilled your requirement. And as we promised will validate the issue ‘’Replace image path with image source on exporting as HTML’’ and update you with further details on 21st April 2022.

Regards,
Kalaivannan Ganesan



KG Kalaivannan Ganesan Syncfusion Team April 21, 2022 03:04 PM UTC

Hi David García,

We have confirmed the issue with “Image is not embedded on modifying the image source by ImageNodeVisitedEvent” and logged the defect report in the SfRichTextBoxAdv control. The fix for this bug will be included in our upcoming essential studio weekly NuGet release which is estimated to be
available on 4th May 2022.

Once the weekly NuGet is released, we will provide you with a sample application to modify the image source and export it as an embedded image in the HTML.

Regards,
Kalaivannan Ganesan




KG Kalaivannan Ganesan Syncfusion Team May 4, 2022 12:29 PM UTC

Hi David García,

We have included the fix for mentioned “Image is not embedded on modifying the image source by ImageNodeVisitedEvent” in our latest Weekly NuGet (v20.1.0.52). We are glad to announce that our latest Weekly NuGet is now available. You can use that latest NuGet to get resolve this issue at your end.

In SfRichTextBoxAdv control, we have provided an option to specify HTML export settings. Using this event ImageNodeVisitedEvent of the HtmlImportExportSettings instance, you can get or set the image stream and image source. On setting the image source as Null, the inserted picture can be exported as an Embedded image on the HTML.

We have also prepared the same to demonstrate the same which can be downloaded below,


Regards,
Kalaivannan Ganesan



Attachment: Save_as_Embedded_Image_d81f8f2b.zip

Loader.
Up arrow icon