Insert MS Word .rtf file content as value for Rich Text Editor

2 Answers 130 Views
Editor Upload
Gizmo
Top achievements
Rank 1
Iron
Gizmo asked on 12 Nov 2021, 11:15 AM | edited on 15 Nov 2021, 07:54 AM

Hello!

I want to perform the following: load MS Word (.rtf) file content using internal API (the format is {content: binaryArray, contentType: 'application/octet-stream'}) and insert the file content as a value for RTE for the read\update\save.

It is some kind of replacement for manual copy\paste from the opened .rtf file in MS Word.

Currently, when I receive the rtf file in the aforementioned format, I see the rtf specific text in RTE editor (screen in attachments).

I am able to receive a content and create a BLob based on it to download the file, but that's all what i have for now and i am looking at the control that may embed MS Word content with styling\formatting "on the fly".

Is there a case for this? Can I dynamically read\set such kind of content?

 

Regards,

Andrey

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 16 Nov 2021, 05:50 AM

Hello, Andrey,

I can suggest checking the following article on sanitizing the content from MS Word. The article is for paste, but the main idea is that the content has to be processed in order to be used and displayed correctly in the Editor:

https://www.telerik.com/kendo-react-ui/components/editor/paste/

Regards,
Stefan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Gizmo
Top achievements
Rank 1
Iron
answered on 16 Nov 2021, 09:01 AM

Hi Stefan,

Thanks for the answer. I have had a look into pasting from MS Word and it is not my case. 

Am I correct that RTE cannot work directly with RTF files i.e. take RTF content as value without any conversion?

It seems that I have to convert file to HTML format and pass as value to RTE, because when I pasted RTF content from MS Word, it appears as HTML formatted in RTE component.

Stefan
Telerik team
commented on 16 Nov 2021, 12:47 PM

Hello, Andrey,

Yes, I can confirm that in order to use RTF content it has to be converted to HTML before that in order for the Editor to display it.

For example, our Telerik Document Processing library product has an option to do this conversion on the server. Based on the type of server the application uses, this could be a valuable option:

https://docs.telerik.com/devtools/document-processing/introduction

 

Gizmo
Top achievements
Rank 1
Iron
commented on 16 Nov 2021, 02:25 PM | edited

Thanks, Stefan!

It might be a case for me, I mean using Document Processing library.

Tags
Editor Upload
Asked by
Gizmo
Top achievements
Rank 1
Iron
Answers by
Stefan
Telerik team
Gizmo
Top achievements
Rank 1
Iron
Share this question
or