Is there any way to render WPF RichText control to image from behind the scenes. It seems that works for XamBarCode but not for XamRichTextEditor.
thanks
Hello Primoz,
Thank you for your post. I have been looking into it and I can suggest you see this blog:
http://www.infragistics.com/community/blogs/petar_monov/archive/2012/03/14/controls-to-images.aspx
where Peter explained how you can export a control to Image or Excel. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
Hello Stefan,
I am already using RenderTargetBitmap for exporting images from WPF controls the problem is that this has to be done from the code where that control is not used on the screen (inside XAML). This works well with MS RichText, the problem is that the control is lacking some finctionality .
regards
Helo Stefan,
This is almost what I need, but my implementation still requires exact contents size and rendering from separate STA thread(windows service). Currently I am using stock RichEdit control which is part of .NET.
thanks,
primoz
In the sample the XamRichTextEditor is not added to the MainWindow. Is this approach suitable for you?
Basically what I need is a way to check if RichText contents fits inside the visible area. The contents is than rendered in a separate (background) STA thread, without any interaction with main thread or main window.
regards,
I have been investigating this further and it seems like that currently you are not able to render the XamRichTextEditor without setting its Height and Width on a different thread. The ting you can do is suggest a new product idea for our future versions here:
http://ideas.infragistics.com/
I really appreciate the effort. Is there any other way to determine if the content fits inside the visible area. Maybe I can go anather way around and start from fixed width/height and fit the contents inside.
You can try to calculate the size based on you document content and set it to the Grid that will contain the XAmRichTExtEditor.