4 Answers, 1 is accepted
0
Accepted

Wenjie
Top achievements
Rank 1
answered on 11 Jul 2013, 04:48 PM
Default printer only.
System.IO.MemoryStream mstreamPdfToPrint;
private void btnLoadPdf_Click(object sender, RoutedEventArgs e)
{
e.Handled = true;
string strPdfFilenName = "";
var dlg = new Microsoft.Win32.OpenFileDialog();
dlg.Filter = "PDF files (*.pdf)|*.pdf";
if (dlg.ShowDialog().Value)
{
strPdfFilenName = dlg.FileName;
System.IO.FileStream fstreamLoaded = new System.IO.FileStream(strPdfFilenName, System.IO.FileMode.Open, System.IO.FileAccess.Read);
mstreamPdfToPrint = new System.IO.MemoryStream();
fstreamLoaded.CopyTo(mstreamPdfToPrint);
}
}
private void btnPrintPDF_Click(object sender, RoutedEventArgs e)
{
e.Handled = true;
Telerik.Windows.Controls.RadPdfViewer rdPdfViewerPrint = new Telerik.Windows.Controls.RadPdfViewer();
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider prvdPdfPrint = new Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider(mstreamPdfToPrint, Telerik.Windows.Documents.Fixed.FormatProviders.FormatProviderSettings.ReadAllAtOnce);
rdPdfViewerPrint.Document = prvdPdfPrint.Import();
rdPdfViewerPrint.Print(new Telerik.Windows.Documents.Fixed.Print.PrintSettings(@"Document1", true));
}
0

Rouven
Top achievements
Rank 1
answered on 12 Jul 2013, 05:26 AM
Thank you Wenjie, this works perfect.
0

Klaus
Top achievements
Rank 1
answered on 06 Nov 2013, 02:25 PM
We have a Silverlight application running with elevated rights, do you have a solution where we can load and print a PDF document silently?
0
Hello Klaus,
RadPdfViewer for Silverlight allows you to print to the default printer in Silverlight OOB applications with elevated trust. What you should do is set the UseDefaultPrinter in the PrintSettings property to true. Please refer to the documentation of the printing feature here.
I hope this helps!
Regards,
Petya
Telerik
RadPdfViewer for Silverlight allows you to print to the default printer in Silverlight OOB applications with elevated trust. What you should do is set the UseDefaultPrinter in the PrintSettings property to true. Please refer to the documentation of the printing feature here.
I hope this helps!
Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>