1
votes

I have a Silverlight 4 app which is essentially a canvas filled with user-drawn controls. When I use Print (or Print Preview) in Firefox 3.6, the canvas is not displayed.

Every example wrt printing in Silverlight creates a Print button within their Silverlight app. Isn't there a browser event I can hook into (or something) so that the user can print from the browser instead of the application?

2

2 Answers

0
votes

You should be able to invoke the browser print method with:-

HtmlPage.Window.Invoke("print");

Note that (if it works at all) this will only print the visible portion of the Silverlight plugin.

0
votes

There appears to be a Microsoft-specific beforeprint event. But, in general, I think you're out of luck. Even with Microsoft, the print event cannot be cancelled, so the page would print in addition to the application.