Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to remove the footer and header from a web page while printing

 
Anurag Mishra
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I am trying to print a HTML page from IE. So any body have an idea that how can I remove the footer and header from a web page using IE through code, while printing. I know that it can be done by File > Page Setup > Header and Footer. But I want to do it by code. So any javascript magic or any style sheet trick? .....Thanks in Advance.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.irt.org/script/1437.htm
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "Anurag"-

Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

Enjoy your time here.
 
Srivatsan santhanam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess, the below code should suffice..

<link rel="stylesheet" type="text/css" media="print" href="print.css" />

print.css:
@media print{
body{font-family: arial; font-size: 6pt; border-width: 1px; border-style: dashed;}

// Your other Defs which you want to include for Pretty Print
}
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Srivatsan,

The poster is asking about the settings that can not be changed with CSS, only manipulating browser settings.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic