Use with RadDocument

6 posts, 0 answers
  1. Adam
    Adam avatar
    32 posts
    Member since:
    Sep 2010

    Posted 29 Nov 2011 Link to this post

    This control might help me solve a problem I'm having with printing RadDocuments.

    My client would like a way to print RadDocuments without exporting them first. The native silverlight printing is too slow (some documents are rather large). 

    My questions are: Does the printing feature of this control use the native silverlight bitmap printing or something else? And will you provide a tutorial for integrating with RadDocument?

    Thanks!
  2. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 01 Dec 2011 Link to this post

    Hi Adam,

    Currently RadPdfViewer uses Silverlight 4 native printing, which is rather slow for big documents. However, soon after the official release of SL 5 we will utilize the new SL5 printing in RadPdfViewer and the performance should be improved. 

    As for the integration with RadDocument you can use PdfFormatProvider to convert RadDocument to Stream and create a new PdfDocumentSource using this stream. We are considering adding an example of how this can be done in the Q3 service pack. If you encounter any difficulties in implementing it now, you can get back to us for further assistance.

    Greetings,
    Kammen
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Sébastien
    Sébastien avatar
    17 posts
    Member since:
    Mar 2011

    Posted 03 Apr 2012 Link to this post

    Hello Telerik,

    I need to print the whole content of the current navigation page, almost as a printscreen but I need to print all the content of the current page (multiple gridview with multiple records).

    I was wondering if it was possible to use the RadDocument class to import it in the PdfViewer in order to print the page.

    How can I do that?

    Can you assist?
  5. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 04 Apr 2012 Link to this post

    Hi Sebastien,

    It is not necessary to create RadDocument or export it to RadPdfViewer to print your page's content. The printing is Silverlight works with VisualElements. So you can pass your visual to the printer and it will print.

    void pd_PrintPage(object sender, PrintPageEventArgs e)
    {
         e.PageVisual = YourPage;
    }

    More information about printing in Silverlight can be found here.


    Kind regards,
    Kammen
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Sébastien
    Sébastien avatar
    17 posts
    Member since:
    Mar 2011

    Posted 25 Apr 2012 Link to this post

    Hello Telerik, Sorry for the late feedback.

    The result of the printing is aweful and it doesn't give me the result I really need.

    I was wondering if I could print the whole content of the page: if I have two grid view with thousands of rows each I want to print it all.

    with the code in the link you provided I do not get this result at all.

    Can you assist?

    Regards
  7. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 27 Apr 2012 Link to this post

    Hello Sébastien,

    You need to add custom logic in order to make printing work in your case. You would have to get the data from the GridViews and present it in some way. Then, you can add the other UI elements until all the content is printed. You have to take care of the way the content should be split in pages. The article Kammen previously quoted in MSDN can help you get started, but is not a ready solution.

    RadRichTextBox and RadPdfViewer have an implementation of printing which concerns only their documents. The controls make sure to split the content in pages correctly and pass them consecutively to the PageVisual property of the PrinPageEventArgs. RadGridView can be printed using RadDocument, as illustrated in this example. However, none of the controls provide a way to print a whole page (custom control). Such a task depends heavily on the layout of the custom control and is not in the scope of the functionality that RadConrols offer.

    All the best,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner