File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes how to remove the footer and header from a web page while printing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to remove the footer and header from a web page while printing" Watch "how to remove the footer and header from a web page while printing" New topic
Author

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

Anurag Mishra
Greenhorn

Joined: Feb 16, 2006
Posts: 5
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.


Best Regards,<br /> <br />Anurag Mishra<br />SCJP 1.4(88%), MCP, MCSE
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

http://www.irt.org/script/1437.htm


[My Blog]
All roads lead to JavaRanch
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42263
    
  64
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.


Ping & DNS - my free Android networking tools app
Srivatsan santhanam
Greenhorn

Joined: Jan 04, 2006
Posts: 23
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
}


Java Objects passed by Reference ?? -> you are a failure !!
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Srivatsan,

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

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to remove the footer and header from a web page while printing