2

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..

Sharad
  • 963
  • 11
  • 24

1 Answers1

1

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.

Community
  • 1
  • 1
Arnaud Leymet
  • 5,995
  • 4
  • 35
  • 51
  • Hi Arnaud. As said in the question, I want to do a whole lot of things, not just change the styles using print CSS. Also I am open to having COM components or plug-in. – Sharad Aug 31 '10 at 06:12
  • See http://stackoverflow.com/a/3619706/198953 for a good solution cross browsers. – cederlof Oct 06 '15 at 08:44