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

[Solved] Use with RadDocument

5 Answers 347 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Adam
Top achievements
Rank 1
Adam asked on 29 Nov 2011, 05:49 PM
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!

5 Answers, 1 is accepted

Sort by
0
Kammen
Telerik team
answered on 01 Dec 2011, 11:13 AM
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 >>

0
Sébastien
Top achievements
Rank 1
answered on 03 Apr 2012, 07:48 PM
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?
0
Kammen
Telerik team
answered on 04 Apr 2012, 04:55 PM
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 >>
0
Sébastien
Top achievements
Rank 1
answered on 25 Apr 2012, 04:38 PM
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
0
Iva Toteva
Telerik team
answered on 27 Apr 2012, 11:22 AM

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

Tags
PDFViewer
Asked by
Adam
Top achievements
Rank 1
Answers by
Kammen
Telerik team
Sébastien
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or