Declined
Last Updated: 04 Jan 2024 13:37 by ADMIN
Legrand
Created on: 27 Dec 2023 14:20
Category: UI for .NET MAUI
Type: Bug Report
0
RadRichTextEditor : image not displayed

I have an html file with <img src="./images/ForkliftGateMainPage.png" alt="MainPage" width="1600" title="Page principale" />

The image is displayed when I open it with my browser, but not displayed with RadRichtextEditor, Why ?

7 comments
ADMIN
Didi
Posted on: 04 Jan 2024 13:37

Hello Legrand,

I think there is a misunderstanding. Maybe I didn't explain it clear. You can insert images in the editor from a file on the device. Here is more information for working with images: https://docs.telerik.com/devtools/maui/controls/richtexteditor/working-with-images/overview for example when you insert and image from the device to the RichTextEditor by using the exposed toolbar item, Internally we convert this image to base64 sting and include it in the editor (we do not include the path on the device). If you export the file and check the html code you will notice the image is base64 string. 

The project I attached in previous replies uses path to the image added to the Raw folder in the project (here the challenge is to find the correct path - this is outside of the RichTextEditor scope)There isn't an option to pass a path in the html file that leads to an image on the device. 

I hope this explains the situation.

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.

Legrand
Posted on: 04 Jan 2024 13:21

I tried with the absolute path (my file is on the hard disk) but image is not displayed.

<img src="C:/tmp/doc/images/ForkliftGateMainPage.png"  ...

it is not an embedded resources.

 

What is the correct file path ?

 

 

ADMIN
Didi
Posted on: 04 Jan 2024 11:09

Hi Legrand,

The behavior is related to an incorrect file path. If you pass the correct file path the image will be displayed. Similar to the example I shared in my previous reply. 

I have logged an internal item for a research whether another option for displaying images could be provided. For now the options you can use are described in my previous post.

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.

Legrand
Posted on: 04 Jan 2024 09:00

I could display my image with base64 (on Windows PC)

 

This mean we have to modify our documents, in order to change all the relative path to Base64. This is not really convenient.

 

As I understood the problem is with the webview, and we can't do anything, right ?

ADMIN
Didi
Posted on: 04 Jan 2024 07:03

Hello Legrand,

You have the following options to set images in the html file:

As base64 string, URI and file (if you know the correct file path, then the image will be displayed) 
This <img src="./images/ForkliftGateMainPage.png"  is not a correct path. The image could be on this location in the project but actually it is not a correct file path for the image to be displayed. I have attached a project where the image is added inside the Resources/Raw folder. The html file is added to the project as embedded resources and the correct file path to the image on Android is: 

<img src="file:///android_asset/bot1.png"/>

You can also convert the images to a base64 string then add the string to img src to the html file.

I have changed the bug report status to Declined, as it is not a valid bug report. The behavior is related to the correct file path.

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.

Attached Files:
Legrand
Posted on: 03 Jan 2024 13:52

Hello Didi,

I don't understand what you want me to test.

 

My goal is to use the RadRichTexteditor to display and update an HTML document with images.

 

ADMIN
Didi
Posted on: 02 Jan 2024 11:48

Hi Legrand,

RichTextEditor uses internally a WebView control. Have you tried the same scenario with the WebView? I have tested the case with a WebView and image is not displayed in it. It seems the behavior comes from the WebView control. Here is the link I have found: https://stackoverflow.com/questions/74647339/inmemory-html-and-images-for-net-maui-webview 

Let me know the results from the test. 

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.