Printing PDF as non image

3 posts, 0 answers
  1. Kedar
    Kedar avatar
    15 posts
    Member since:
    Jun 2012

    Posted 25 Jul 2013 Link to this post

    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. Alexander
    Admin
    Alexander avatar
    41 posts

    Posted 30 Jul 2013 Link to this post

    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 >>
  3. DevCraft banner
  4. Kedar
    Kedar avatar
    15 posts
    Member since:
    Jun 2012

    Posted 30 Jul 2013 Link to this post

    Hi,

    Thanks for your inputs. Ours is WPF application.

    thanks,
    Kedar.
Back to Top