If a webpage gets printed the browser automaticaly adds a header/footer. How can this be hided without ActiveX
Written by ScriptInstaller on April 2nd, 2009
zoernert asked:
If a webpage gets printed the browser (esp. InternetExplorer) automaticaly adds a header and a footer. So far I know that this header and footer can be modified via the registry or via an ActiveX component (ex. http://www.htmlprinting.com/).
My question:
Is it possible to hide the header and footer with Style-Sheets, JavaScript or other Script that does not require a Client-Side installation or modification?
Addition:
The target is to print from a website without having the user to modify the system. That means that I want to render for example an invoice and allow the user to print it (wihout header and footer – added by the browser).
Related Blogs
- MPEG programming – Part One MPEG Header « – 富 – XSATRIA – 富 -
- browser warnings « Manifest Density
- Bo-DMweapons2.jpg » Living Sense
- Pac Div feat. The Cool Kids “Shut Up” Music Video | Highsnobiety.com
- What's the difference between PHP, IFrame and DIV Coding when your …
Tags: Activex Component, Automaticaly, Browser, Header Footer, Invoice, Webpage

3 Comments at "If a webpage gets printed the browser automaticaly adds a header/footer. How can this be hided without ActiveX"
WHOA ,I usually highlight what I want to print and go from there
your question is not clear…don’t know why you are talking about active X, java script etc…the simple way is to copy the portion you want by right clicking and choosing the portion you want and paste it in a word document and print it
CSS is the best way to go. Let’s assume you have a file called “print.css” and your header and footer are in DIV tags with the ids “header” and “footer”, respectively. Then you can put this on your page:
And put this in print.css:
#header, #footer {
display: none;
}
The #header and #footer divs will automatically be hidden when the user tries to print. (Wikipedia is a great example of this)
Good luck!
Edit: If you’re referring to the page number and web address that get printed at the top/bottom of every page, the only way to remove that is in the File > Page Setup on each client machine.