This is a migrated thread and some comments may be shown as answers.

Can't display wmetafile8 images

6 Answers 507 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 23 Sep 2015, 01:48 PM

I've got hundreds of thousands of RTF files with embedded images that use the {\pict\wmetafile8 tag.  When I load them into the radRichTextBox, the images won't display (I see a red 'X' broken image link icon).

Is there any way I can get them to display or is there I way I could programmatically alter RTF files to manipulate the images into a format the radRichTextBox can handle?  I am ok if the solution causes a loss of some quality on the images.

6 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 28 Sep 2015, 07:54 AM
Hi Brian,

You are correct the reason images are not rendered is that they are actually WMF images. Those images are not supported out-of-the-box from RadRichTextBox.

The good news is that we have a demo in our SDK repository on GitHub which demonstrates how to implement an image decoder for that image format. You can find the demo here. Please note, the demo has a reference only to the DocxFormatProvider assembly. In order to test it with a Rtf file, you should add a reference to the Telerik.Windows.Documents.FormatProviders.Rtf as well. 

I hope this helps.
If you have further questions, I'll be glad to assist you.

Regards,
Todor
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Brian
Top achievements
Rank 1
answered on 30 Sep 2015, 01:04 PM
Thanks - this is exactly what we needed, it seems to have solved the problem perfectly!
0
Shankar Ram
Top achievements
Rank 1
answered on 19 Feb 2016, 01:51 PM

doesn't work for me still - the red 'X' broken image link icon persists. Don't get any errors, though. Could it have to do with the size (1920 x 1080)? Am able to save the png onto the file system without a problem.

The decoder's decode gets hit correctly when I call the Import on the RtfFormatProvider object.

Really driving me crazy :) Any pointers would be awesome. 

0
Todor
Telerik team
answered on 24 Feb 2016, 08:46 AM
Hi Shankar Ram,

Can you isolate the issue in a sample project and send it to us or at least send us the image which cannot be rendered? In this way, it will be much easier for us to find what might cause the problem and try to solve it.

Looking forward to your reply.

Regards,
Todor
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Shankar Ram
Top achievements
Rank 1
answered on 24 Feb 2016, 09:11 AM

sure -hmm, unfortunately unable to attach the original wmf , neither the png (size > 2 MB). Please send me an email address where I can send the files to.

Thanks for having a look!

0
Todor
Telerik team
answered on 24 Feb 2016, 09:39 AM
Hi Shankar Ram,

The public forums don't allow attachments other than images which cover the requirements as you already mentioned, so it would be best if you open a support ticket through your Telerik account and to attach the image or the project there. 

Please excuse me I didn't share that information in my previous post.

Regards,
Todor
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Brian
Top achievements
Rank 1
Answers by
Todor
Telerik team
Brian
Top achievements
Rank 1
Shankar Ram
Top achievements
Rank 1
Share this question
or