Image type changing when converting an RTF to DOCX

1 Answer 44 Views
WordsProcessing
Thomas Mittag
Top achievements
Rank 1
Thomas Mittag asked on 19 Jan 2022, 07:08 PM
I am using the telerik document format providers to read an RTF and convert it to a DOCX format. the document contains embedded images in PNG format, but looking at the output of the DOCX it looks like the images have been converted to WMF format. Is there a way to preserve the original image type?

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 20 Jan 2022, 12:43 PM

Hello Thomas,

I have tested this and it works as expected on my side. It depends on how this image is saved in the RTF file. For example, if the file is created with WordPad even if a PNG image is added, it is stored as WMF and when converting the format is preserved and a WMF image is used. You can examine this by opening the RTF file with a text editor. If the "wmetafile" tag is used the image is stored as WMF (see attached), the "pngblip" indicates a PNG image. More information is available here: Rich Text Format (RTF) Version 1.5 Specification.

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
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/.

Tags
WordsProcessing
Asked by
Thomas Mittag
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or