Control header/footer printing

A

Andrew Poulos

I can setup a print CSS file to control how my page prints but is there
a way to hide the header and the footer?

Currently the page's title and URL display in the header and page number
and date in the footer and I'd rather they didn't print.

Andrew Poulos
 
E

Evertjan.

Andrew Poulos wrote on 06 mrt 2008 in comp.lang.javascript:
I can setup a print CSS file to control how my page prints but is there
a way to hide the header and the footer?

Currently the page's title and URL display in the header and page number
and date in the footer and I'd rather they didn't print.

That is browser dependend,
and not under the influence of the page's javascript.

That it is not under the influence of the page's CSS is OT.

[If you want to have a complete say over the print layout, use pdf.]
 
J

Joost Diepenmaat

Andrew Poulos said:
I can setup a print CSS file to control how my page prints but is
there a way to hide the header and the footer?

Currently the page's title and URL display in the header and page
number and date in the footer and I'd rather they didn't print.

If you're using CSS media specification you can just set display: none
(or display: hidden) on everything you don't want to print.

Should work on most modern browsers, at least it worked in IE and
Mozilla last time I checked (5 years ago).
 
J

Jeff North

| I can setup a print CSS file to control how my page prints but is there
| a way to hide the header and the footer?
|
| Currently the page's title and URL display in the header and page number
| and date in the footer and I'd rather they didn't print.
|
| Andrew Poulos

As others have stated, this is not a javascript of css problem.
You can however use an ActiveX control to set margins etc

http://www.meadroid.com/scriptx/freedep.asp

Note that is will not work in browsers that do not support ActiveX.
The user will be prompted to install this on their machine (you may
want to have some information about this on your web page).
It changes the settings of the printer and can affect other
applications.
-- -------------------------------------------------------------
(e-mail address removed) : Remove your pants to reply
-- -------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top