Sharad
Sharad

Reputation: 973

Capturing Print Events via Jquery/JS/Browser Specific APIs

I wanted to ask if there is a way to capture the print events (like IE onbeforeprint and onafterprint events). Actually I would like to do more. I want to know if I could interrupt printing, cancel it or may be change the print option all together to have a myPrint option. Can this be achieved through plug-ins/extensions/XPCOM ? Actually I want a cross-browser control and I dont mind having separate control in different browsers.. Like via a plug-in in IE, extension/XPCOM in mozilla and Chrome extensions if possible..

Upvotes: 2

Views: 3018

Answers (1)

Arnaud Leymet
Arnaud Leymet

Reputation: 6132

I'll quote danieltalsky answer to the Javascript Event Handler for Print post since I think that the same applies in your situation:

In IE there are the nonstandard window.onBeforePrint() and window.onAfterPrint() event listeners. There isn't a non-IE way to do it that I know of, however.

What kinds of changes are you trying to make? It's possible that your problem could be solved by specifying different rules for your print stylesheet.

Upvotes: 1

Related Questions