SecurityException when trying to print document

3 posts, 0 answers
  1. Geir-Tore
    Geir-Tore avatar
    20 posts
    Member since:
    Jun 2009

    Posted 03 Jul 2013 Link to this post

    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. Nathaniel
    Nathaniel avatar
    68 posts
    Member since:
    Nov 2010

    Posted 06 Jun 2016 Link to this post

    I'm seeing this exception too. 
  3. Deyan
    Deyan avatar
    171 posts

    Posted 09 Jun 2016 Link to this post

    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.

    the Telerik team
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top