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
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
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.
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
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!
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