But you have got to realize that the window.print() method provides little or no control over the printing settings. Its just a nicety and is equivalent to pressing Ctrl + P.
Even the documentation doesn't provide any significant information about this function. It actually makes sense since its the user who decides what and how things have to printed and not the site developer. Messing around a bit with your printer settings is the only way to go.
I've developed an intranet application where the user click on button
I create the invoice into an html page and open it with minimun size, print and then close it.
<body on load='window.print();window.close()'>
I've found something about print job into CSS2 Specification arround PAGED MEDIA groups but nothing to control head and footer of printed document.