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

Printing PDF as non image

2 Answers 86 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Kedar
Top achievements
Rank 1
Kedar asked on 25 Jul 2013, 11:14 AM
Hi Telerik Team,

Want to check if we can force pdf viewer to print a pdf file as non-image. Following is the sample how I am printing a pdf document, can you let me know if this is the right way?

pdfViewer1.DocumentSource = new PdfDocumentSource(new Uri(@"D:\Sample.pdf"), FormatProviderSettings.ReadAllAtOnce);             
pdfViewer1.DocumentChanged += pdfViewer1_DocumentChanged;

void pdfViewer1_DocumentChanged(object sender, EventArgs e)        
{             
    pdfViewer1.Print();
}

thanks,
Kedar.

2 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 30 Jul 2013, 02:19 PM
Hi Kedar,

In Silverlight you don't have permission to load documents from the file system. You can load a document using Application.GetResourceStream(Uri) method if the document is embedded in the project as a resource, or by providing a stream that supports Seek and Read operations in some other way. 

When it comes to printing, the Print method of RadPdfViewer shows a PrintDialog which must be user-initiated in order to work in Silverlight. Therefore, it will not be possible to trigger it in an event. There are settings that allow printing to the default printer, but they can be utilized only in OOB mode. More information on their use can be found in the WPF forum.

In Silverlight 5 RadPdfViewer uses vector printing by default, so there are no additional settings that must be specified. If the vector printing fails for some reason, however, bitmap printing will be used instead.

I hope this is helpful.

Regards,
Alexander
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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 >>
0
Kedar
Top achievements
Rank 1
answered on 30 Jul 2013, 03:01 PM
Hi,

Thanks for your inputs. Ours is WPF application.

thanks,
Kedar.
Tags
PDFViewer
Asked by
Kedar
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Kedar
Top achievements
Rank 1
Share this question
or