Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

suppress default header & footer when printing 4

Status
Not open for further replies.

OhioSteve

MIS
Mar 12, 2002
1,352
0
0
US
I am printing a bunch of form letters to a web page. Then the user can then inspect the output and print it. I have already included a div to force pagebreaks. Here is the div~

<div style="page-break-before:always">
text text text
</div>


I did this WITHOUT defining a css in the page head. I was pleasantly surprised when it worked without that.

Now, when I actually print the web page, the output has a page number in the header. It also has the url and a date in the footer. I want to suppress those things. Do I need to make a real CSS to do that? If I do need a CSS, can you give me some hints on syntax?
 
Nevermind, I tried this and it worked.
Code:
<A HREF="JavaScript: close();" OnClick=ResetHeader()>Click Here</A>



Hope This Helps!

Ecobb

&quot;My work is a game, a very serious game.&quot; - M.C. Escher
 
Ecobb,

Glad it worked for you. [bigsmile]


OhioSteve,

Let me know if you got the printpage function working or not. I'd like to make sure that I'm not the only one that can get it to work. Nothing like implementing a script that only works on the developers computer. [surprise]

Thanks for the feedback,

TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
 
Something along the similar line of thought (adjusting printing settings)...is there a way to change the format to landscape programmatically? Thanks for any assistance that can be provided.

Chris
 
There is an active-x plugin for IE that handles a lot of that automatically, ScriptX from and it gives a lot of other controls like border sizing and landscape/portrait settings, and automatically resets the settings back for all other pages.

The base version that does all above is provided free.
 
Thanks, Dakota81. I saw that tool...was wondering if there was some way besides a component. I also saw the CSS page selector, but that doesn't seem to work in IE. Again, any help would be appreciated. Thanks.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top