How to integrate RadRichTextbox Content in FlowDocument

5 posts, 0 answers
  1. Matt1234
    Matt1234 avatar
    13 posts
    Member since:
    Nov 2009

    Posted 16 Feb 2011 Link to this post

    Hello, 

    I would like to convert data from a silverlight application into a XPS document.
    Do do this, I want to create a FlowDocument on the server side and export it to XPS which can then be downloaded via the Silverlight client.
    The FlowDocument should contain (among other things) the content of a RichTextBox. 

    Now, here's my question: Is it possible to integrate the RadDocument into a WPF FlowDocument? 
  2. Matt1234
    Matt1234 avatar
    13 posts
    Member since:
    Nov 2009

    Posted 18 Feb 2011 Link to this post

    I'm now using the CTP WPF RadRichTextBox inside the FlowDocument, which works when printing / exporting from a WPF client, but unfortunately not from ASP.NET (the formatting gets messed up). 

    Because it's a problem with the WPF version, I created a thread in the WPF RichTextBox forum, but because it's the result of my attempts to integrate RadRichTextBox content in a FlowDocument, I'm also posting the message here:



    Hello, 
    I'm trying to use the WPF RichTextBox to integrate RadDocument content (which was entered in a Silverlight RichTextBox) into a FlowDocument and export it to XPS. 
    The XPS looks just fine when I print / export it from a WPF application, but when I export it form ASP.NET the whole formatting of the text in the RadDocument gets all messed up. 

    I added the details as a word document, you can look at it here: Richtextbox Format Problem

     Now, here are my questions:
    1. Is there any way to make this work (using RichTextBox from an ASP.NET app / WCF service? I’m also open to alternative ways of integrating the RichtextBox content into my FlowDocument.
    2.  I think you should really work on a pagination enabled solution which makes it easy to integrate the content of a richtextbox into a larger FlowDocument, because I don’t think I’m the only one who has the problem of having to integrate Richtext into a form – in fact I think it’s a perfect use case for this kind of control, but there has to be a practical way to print the rich text in context with the rest of the data from the entry form.
    3.  If there’s no way to integrate the rich text stuff right now (and I mean a better way than integrating the richtextbox, I need something that can paginate), will there be a solution in the Q1 2011 release? Otherwise I need to look for alternatives to make my deadline.
  3. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 21 Feb 2011 Link to this post

    Hi Matt1234,

    From what I could gather, you're trying to embed RadDocument contents into a FlowDocument. RadDocument is designed to be used as a standalone, fully featured document format. Embedding it into other documents and embedding other documents in it is not in the focus of RadRichTextBox and the RadDocument model.
    If you are trying to construct a document and then make it ready for printing, I'd recommend using the RadDocument API and/or RadRichTextBox as a means of creating a document and then using PDF exporting to print it. PDF is well spread and suitable for printing, so this should be a good solution to your problem.
    PDF export should also work correctly under ASP.NET and you should be able to provider your users with a complete printing solution, preserving formatting completely.
    FlowDocument and RadDocument are incompatible as they are based on completely different document models. If you require full pagination, text wrapping and so on, you should stick with one of them and implement all your functionality with it. The RadRichTextBox control with its RadDocument model is designed to be a superset of FlowDocument so you should be able to use them for anything you are used to do with FlowDocument. Let us know if we can assist you with implementing the functionality you currently have with our control.
    If, however, XPS exporting is your end goal, we have planned two feature enhancements that will aid your scenario: XPS format provider and a format provider which converts to and from FlowDocument. When any of these features is available, what you are currently trying to do will become very easy.

    Kind regards,
    Ivailo
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  4. Matt1234
    Matt1234 avatar
    13 posts
    Member since:
    Nov 2009

    Posted 22 Feb 2011 Link to this post

    Hello Ivailo,

    thank you very much for the information. 

    Will the export / import - functionality be implemented in the Q1 2011 release?
  5. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 23 Feb 2011 Link to this post

    Hi Matt1234,

    We have PDF exporting since 2010Q2. PDF importing is not supported and I currently can't provide any information on it.
    As it goes for XPS, it's in our to-do list, but not scheduled yet. It most certainly won't be available in 2011Q1 and it's unknown when it will be available.

    Greetings,
    Ivailo
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top