I understand that using JavaScript and window.print() has limitations around setting certain print options (due to security issues). I also understand that CSS has the ability to set certain elements (like @page) for setting a document to landscape.
Is there a way to use CSS to set print options like zoom, margins, and hide header/footer? If so, does anyone have any code samples for doing this? If this is not possible using JS or CSS, is there any any other tools I could use to put a print button on a page that automatically sets certain print options?
UPDATE: Okay, I appreciate everyone’s responses, and now that I have dug in a bit, I have more clarification on what I need… I do not need to modify the CSS on the page. I need to automatically set the local print options when the user clicks the button. I am in a .Net application. Any ASP.NET controls for this? Thanks.
You can simply add another style-sheet that is specific for printing:
And in that stylesheet you just put stuff like: