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

Detecting lack of PDF plugin with True Printing

3 Answers 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Karen
Top achievements
Rank 1
Karen asked on 15 Feb 2012, 04:25 PM
I am using Silverlight Report Viewer with UseNativePrinting = false.  If Adobe PDF plug-in is not detected then I am prompted to save the PDF file.  Is there a way of detecting this event and prompting the user that they need to install Adobe PDF plug-in?

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 15 Feb 2012, 04:37 PM
Hi Karen,

There is no way for you to change this behavior. We've done it this way as we need to provide users with some way to print the report upon printing. Several users have reported that they have limited permissions on their machines and cannot install software, so prompting them to install Acrobat Reader does not do them any good.
Moreover there are users utilizing other PDF programs (FoxIt, SumatraPDF etc.) that do not integrate an usable plug-in for printing, while browsers such as Chrome, have their own PDF plug-ins which are handled correctly by our product.

Kind regards,
Steve
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
Karen
Top achievements
Rank 1
answered on 15 Feb 2012, 04:47 PM
Thank you for your very quick reply. I understand the reason behind your approach.  I was wondering whether there is a way for me to intercept the event so I can inform the user there is a problem (not necessarily automate the download of the appropriate pdf)
0
Steve
Telerik team
answered on 17 Feb 2012, 04:59 PM
Hi Karen,

You can make a check on the page with the report viewer, whether the user has Adobe PDF plug-in installed in the browser and prompt him to install it. There are various threads on the net that explain how to accomplish this.
You can also do this specifically for the print button by replacing the original OnPrint client-side viewer object. Here is a sample code which illustrates the approach:

<telerik:ReportViewer runat="server" id="ReportViewer1"></telerik:ReportViewer>  
            <script type="text/javascript">
            var viewer1 = <%= ReportViewer1.ClientID %>;
              
            viewer1.OnPrint = function()
            {
                //detect pdf plug-in and inform user if needed
                alert("Print requires adobe pdf plug-in");
                this.PrintReport();
            };
              
         </script>


Kind regards,
Steve
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
General Discussions
Asked by
Karen
Top achievements
Rank 1
Answers by
Steve
Telerik team
Karen
Top achievements
Rank 1
Share this question
or