PDF Viewer Printing in Hidden Mode & Silently

11 posts, 0 answers
  1. Phani Kumar
    Phani Kumar avatar
    23 posts
    Member since:
    Jul 2012

    Posted 12 Sep 2012 Link to this post

    Hi ,



    Using RadPdfViewer (Q2 Release) in our project to show PDF documents / Reports for viewing and printing purposes.

    There is a requirement to print the PDF file without showing the document and the Print Dialog, could we achieve printing of PDF document through RadPdfViewer control by setting the Visibility to Hidden mode and execute Print Command.

    What settings are to be used for Printing silently through RadPdfViewer (without a Print Dialog).



    Are there any other functions / Rad Controls to print a PDF document



    Regards,

    Phani.















  2. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 13 Sep 2012 Link to this post

    Hello Phani,

    This code is enough to print the document of RadPdfViewer with the default printer, without showing the PrintDialog:
    this.viewer.Print(new PrintSettings("Document 1", true));

    There is no other control that can be used to print PDF documents.


    All the best,

    Kammen
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Phani Kumar
    Phani Kumar avatar
    23 posts
    Member since:
    Jul 2012

    Posted 13 Sep 2012 Link to this post

    Thank you Kammen ,

    Used the below same code and tested, it works without any issues when the Default Printer is virtual drive (like XPS, One Note, etc..)

    Nothing is printed when the Default Printer is set to Actual Printer Drive...



    Below are the code snippets that I have been testing with



    .xaml



    <telerik:RadPdfViewer Name="radPDFViewer" Height="0" />


    .cs

    radPDFViewer.DocumentChanged += radPDFViewer_DocumentChanged;

     




    radPDFViewer.DocumentSource =

     

    new PdfDocumentSource(new System.Uri(labelFileName, UriKind.Absolute), FormatProviderSettings

     

    .ReadAllAtOnce);



    void radPDFViewer_DocumentChanged(object sender, EventArgs e)

     

     

     

    {

     

    radPDFViewer.Print(new Telerik.Windows.Documents.Fixed.Print.PrintSettings(labelFileName, true));

     

     

    }



    Were there any issues with the above code in order to fire the Print to actual printer drive.



    Also could you let me know whether there is an ability to provide the printer name in PDFViewer/Print Settings to always direct printing to a specific printer...



    Regards,

    Phani,

     

     

     

  5. Phani Kumar
    Phani Kumar avatar
    23 posts
    Member since:
    Jul 2012

    Posted 14 Sep 2012 Link to this post

    Any updates on this?



    Created a RadWindow to show the PDF Viewer, added a print Button in the toolbar which is binded to the Print command.

    Print function works on Virtual Drive XPS, but does not print to Actual Printer Drives.(Xerox printers).

    Printing does not work whether the Dialog is shown or hidden.



    I am trying to understand whether there is any issue with the PDF Viewer and does not support printing to some of the Printers...?In that case should I look into alternate option for showing PDF documents and printing?



    The Printers I am testing on are



    XEROX Phaser 6250

    XEROX Phaser 6820N



    Any feedback would be appreciated.



    Regards,

    Phani.







  6. Phani Kumar
    Phani Kumar avatar
    23 posts
    Member since:
    Jul 2012

    Posted 14 Sep 2012 Link to this post

    I got it working, there is no issue in printing PDF documents with RadPDFViewer on Xerox printers.

    It is due to the User once impersonated does not have access to the printers...



    Currently I am managing through some functions to temporarily set the required Printer as Default Printer.

    Just wanted to check whether there is provision to supply the Printer Name to the Printing Functions.



    Thank you & Regards,

    Phani.

  7. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 17 Sep 2012 Link to this post

    Hello Phani Kumar,

    RadPdfViewer can only print silently with the default printer as this is the default WPF behavior. Setting the printer name when printing is not a trivial task and is not recommended since the printer can be offline or out of order.

    That is why we do not plan to support silent printing with printer that is not default one.

    All the best,
    Kammen
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  8. Phani Kumar
    Phani Kumar avatar
    23 posts
    Member since:
    Jul 2012

    Posted 17 Sep 2012 Link to this post

    Alright, at the moment as mentioned I have an alternate solution and do not find any issues regarding this.

    Thanks for the update.



    Regards,

    Phani.



  9. Bradley
    Bradley avatar
    1 posts
    Member since:
    Feb 2013

    Posted 11 Apr 2013 Link to this post

    Has Telerik implemented anything since the last post to allow this? If not do you wish to share your alternate solution to printing the pdf?

    Thanks,
    Brad
  10. Petya
    Admin
    Petya avatar
    975 posts

    Posted 16 Apr 2013 Link to this post

    Hi Brad,

    We are not sure what was Phani's solution, but we have not come up with a workaround in this regard. However, we are taking under consideration the implementation of this feature for one of our future releases.

    Let us know if you have other questions.

    Regards,
    Petya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  11. Mi
    Mi avatar
    16 posts
    Member since:
    Apr 2011

    Posted 23 Apr 2013 Link to this post

    Hi! 

    Is there somewhere a PIT entry for this? So I can vote for it!
  12. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 23 Apr 2013 Link to this post

    Hi,

    Here you can find the PITS Issue: Public URL

    Regards,
    Kammen
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready