How to get a content of embedded images in MAUI RichTextEditor on iOS/macOS

1 Answer 62 Views
RichTextEditor
Raymond
Top achievements
Rank 1
Raymond asked on 29 Jan 2024, 11:09 AM

When images are pasted from a clipboard into MAUI RichTextEditor on iOS/macOS then they're added to the html as series of entries like this:

<img src="blob:null/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx">

How to get a real content of these images?

Or maybe there's a way for forcing embedding these images as a `data:image/...,base64` as on Android?

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 29 Jan 2024, 01:03 PM

Hi Raymond,

You can get the content of the HTML in the RichTextEditor by using the GetHtmlAsync() method. Here are more details: https://docs.telerik.com/devtools/maui/controls/richtexteditor/configuration#retrieving-html-content 

This is the option we can suggest.

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Raymond
Top achievements
Rank 1
commented on 30 Jan 2024, 07:44 AM

HI Didi,

I think that your misunderstood my question.

The problem is that in a HTML returned by GetHtmlAsync() all images pasted from clipboard on iO/macOS are represented as <img src="blob:null/" making this HTML useless as it refers to internal WebView objects.

If you'll try to display this HTML again in you RichTextEditor then you'll not see images.
In order to fix it, we need to replace all <img src="blob:null/" ..../> with some real links, ie <img src="data:image/...,base64 .../> like on Android.

My question is: how we can get actual content of image represented by  <img src="blob:null/" ..../>?

Didi
Telerik team
commented on 01 Feb 2024, 02:24 PM

Hi Raymond,

I have reviewed the case with the development team and I have logged the behavior as a feature request on your behalf here: https://feedback.telerik.com/maui/1639536-richtexteditor-provide-an-option-to-paste-images-copied-outside-the-editor 

Actually this is a missing feature in the control. On WinUI you cannot paste the image outside of the editor. On Mac you do not have a valid source.

Tags
RichTextEditor
Asked by
Raymond
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or