Forum Moderators: open

Message Too Old, No Replies

No header and footer for printing a page

My task is to change header, footer and left/right/top/bottom margins

         

Nagval

9:07 pm on Aug 21, 2004 (gmt 0)

10+ Year Member



My task is to change header, footer and left/right/top/bottom margins from JavaScript on print form of the page in Internet Explorer.
(Not confuse with margins in the tag <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">)

For example, by default when printing a page Internet Explorer added to each printed page following header &w&bPage &p of &P (that means word "Page", number of current page and nuber of total pages) footer &u&b&d(fool URL to the page) and default margins 19,05.
I need to set 0.00 margins and no header and footer for printing a page(for text to begin from top left corner of paper page. WITHOUT ANY SPACES!).

How can I do setup of the printing form of the page from JavaScript or by any other way (may be CSS?) from my web page. I need to do this for Internet Explorer but if that will work in other browsers it would be better.

Will be very thankful for any help in solving this task.

Noisehag

9:40 pm on Aug 21, 2004 (gmt 0)

10+ Year Member



Yes, you can setup a print.css stylesheet to be included in your page. I've only used this moderately, but the include code looks something like this:

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

Then it's just a matter of coding your stylesheet to change the appearance.

A List Apart has a good article on this method to hide or display other content on printing. Google for "a list apart", search for "printing" and look for the article called "CSS Design: Going to Print". Other articles in there will help as well.

Hope that helps...