Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide header and footer when printing from Internet Explorer using Javascript or CSS

When I print a webpage from Internet Explorer it will automatically add a header and footer including the website title, URL, date, and page number.

Is it possible to hide the header and footer programatically using Javascript or CSS?

Requirements:

  • works in IE 6 (no other browser support necessary as its for an Intranet)
  • may use ActiveX, Java Applet, Javascript, CSS
  • preferably not something that the user needs to install (eg. http://www.meadroid.com/scriptx). feel free to list other third party available plug-ins though as I think this may be the only option
  • don't require the user to manually update their browser settings
  • don't render the pages as PDF or Word document or any other format
  • don't write to the registry (security prevents this)

Thanks

like image 516
molasses Avatar asked Jan 16 '09 00:01

molasses


People also ask

How do I remove headers and footers when printing from the Internet?

You can turn off these headers and footers using the following steps: In the Chrome menu, click Print… to open the print preview screen. Click More Settings. Uncheck Headers and Footers.

How do I print without header and footer in HTML?

Google Chrome: Go to the Menu icon in the top right corner of the browser and Click on Print button. Uncheck the “Headers and footers” option underneath the “Margins” option.

How do I turn on header and footer when printing?

Add a header, footer, or legend to a view. In the File tab, click Print, then click Page Setup. On the Header, Footer, or Legend tab, click the Left, Center, or Right tab. In the text box, type or paste the text, add the document or project information, or insert or paste a graphic.


1 Answers

In your print options you can disable this. The only way to do it programatically is with an activeX control which writes to the registry or a script block which is written in VB. The settings for your print options are stored in the registry. The user would have to allow your script to access the registry which most people wouldnt because of security.

If you want to control page content, you can use a css print stylesheet.

Edit: There are 3rd party active x controls which can programatically print for you, but once again, the user would have to choose to download and install it.

like image 143
Jobo Avatar answered Oct 16 '22 16:10

Jobo