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

SecurityException when trying to print document

2 Answers 90 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Geir-Tore
Top achievements
Rank 1
Geir-Tore asked on 03 Jul 2013, 10:36 AM
We have a XAML usercontrol set up as a pdfviewer where we have RadPdfViewer along with a toolbar with buttons for tasks like printing. The command on the print button is bound to the PrintPdfDocumentCommand in the PdfViewer control.

Sometimes our clients report that they can't print and the log indicates that the infamious SecurityException [FileDialog_UserInitiated]. The stack trace is:

at System.Windows.Printing.PrintDocument.PrintInternal(String documentName, PrinterFallbackSettings printerFallbackSettings, Boolean useDefaultPrinter)
at System.Windows.Printing.PrintDocument.Print(String documentName, PrinterFallbackSettings printerFallbackSettings, Boolean useDefaultPrinter)
at Telerik.Windows.Documents.Fixed.Print.PrintManager.Print(PrintSettings settings)
at Telerik.Windows.Controls.FixedDocumentViewerBase.Print(PrintSettings settings)
at Telerik.Windows.Controls.FixedDocumentViewerBase.Print()
at Telerik.Windows.Documents.Commands.PrintPdfDocumentCommand.Execute(Object parameter)
at Telerik.Windows.Controls.RadButton.ExecuteCommand()
at Telerik.Windows.Controls.RadButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

I guess this is due to slow client computers which fail to open the dialog during the one second allowed timeframe between mouse click and dialog opening. Are there any way to work around this?

2 Answers, 1 is accepted

Sort by
0
Nathaniel
Top achievements
Rank 1
answered on 06 Jun 2016, 06:32 PM
I'm seeing this exception too. 
0
Deyan
Telerik team
answered on 09 Jun 2016, 11:48 AM
Hello Nathaniel,

We were not able to reproduce this exception on our side. However, as Gier-Tore mentioned this Silverlight exception usually arises when the print dialog is not called by a button click or if something slows down the process of showing the dialog (for instance a break point during debugging process). Do you reproduce the exception with our online demo on your machine or it happens from time to time on some other client machines? 

As we have previously seen some Silverlight printing issues on computers running Windows 7, a possible solution could be to upgrade to higher version of Windows and also to update printer drivers to their latest version.

I hope this helps.

Regards,
Deyan
the Telerik team
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
PDFViewer
Asked by
Geir-Tore
Top achievements
Rank 1
Answers by
Nathaniel
Top achievements
Rank 1
Deyan
Telerik team
Share this question
or