There is an invoice preview webpage. I want to set header and footer information off while printing it. I know we can edit the page setup settings. But I wanted to know if we can do something without changing the default page setup settings. With default setting inside page setup, webpage title and webpage path are displayed for header and footer respectively. Thanks
try with jquery: $("#printButton").click(function() { $("#header").remove(); $("#footer").remove(); window.print(); }); Code (markup):
Thanks for the above code. But I Need to remove Title from a print out which is header under page setup and URL that acts as a footer by default. Can you help?
All you need to do is to make another css file and add some css. You need to include your print styles with media attribute set to "print" like this <link rel="stylesheet" type="text/css" media="print" href="print.css" /> then for example if you want to hide some website parts while printing you just need to write something like #element{ display:none; } Code (markup): to your print.css file.
it's not possible with javascript (Hopefully! I wouldn't like my settings or something else modified by a page without my permission), but apparently that can be done with some ActiveX. You can easily find some scripts already done on the web, that can allow you to modify some settings like orientation or margins.