faqts : Computers : Programming : Languages : Asp : ASP/VBScript : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

18 of 69 people (26%) answered Yes
Recently 0 of 10 people (0%) answered Yes

Entry

How can I get rid of the header (title, page number) and footer (URL) of an htmlpage when I print?

Jul 13th, 2000 21:57
unknown unknown, wd, Michael S. Comperchio


Well, if you're using IE4+ use the onBeforePrint Event to change the 
output declare this outside of the function:
var OldPage = document.body.innerHTML;
On the onBeforePrint Event:
document.body.innerHTML = document.all.yourDiv.innerHTML;
Then in the onAfterPrint Event:
document.body.innerHTML = OldPage;
You can have a button called PrintDiv that just does this for the div 
and doesn't interfere with the normal print options if you wish.
--------------
There's also:
  <P ID="Paragraph" STYLE="page-break-before:always">  
  <P ID="Paragraph" STYLE="page-break-after:always">



© 1999-2004 Synop Pty Ltd