homepage Welcome to WebmasterWorld Guest from 54.166.14.218
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
print without header and footer
printing
peporro

5+ Year Member



 
Msg#: 10135 posted 6:54 pm on Apr 27, 2005 (gmt 0)

I'm kind or new in this stuff, I want to print my webpage, I have css style for printing and i'm using divs for getting position and to hide/show elements, the thing is that I want to hide the default header and footer but I can't, I'm using IE. any help plz!

 

jimbeetle

WebmasterWorld Senior Member jimbeetle us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 10135 posted 6:56 pm on Apr 27, 2005 (gmt 0)

Hey peporro,

Welcome to Webmaster World.

What you need is at IE's File > Page Setup dialog.

peporro

5+ Year Member



 
Msg#: 10135 posted 7:02 pm on Apr 27, 2005 (gmt 0)

is there a way to do it by code

Span

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 10135 posted 7:02 pm on Apr 27, 2005 (gmt 0)

Welcome to the forums, peporro..

A long time ago I have read about some evil Activex code that could hide the print header and footer, but I think that won't work anymore in SP2.

To show or hide the print header and footer is a client side option. Better stay away from there.

peporro

5+ Year Member



 
Msg#: 10135 posted 7:07 pm on Apr 27, 2005 (gmt 0)

than you very much!

peporro

5+ Year Member



 
Msg#: 10135 posted 7:11 pm on Apr 27, 2005 (gmt 0)

hey guys, another question, do you know if it's possible to print 'n' number of copies by code, I have a button which prints my page once, is there a way to do it? maybe using a do while, I'm really new in this jaja but thanks anyway

Span

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 10135 posted 7:25 pm on Apr 27, 2005 (gmt 0)

Print 'n' number of copies by code? No, not possible.. give it up, peporro..

peporro

5+ Year Member



 
Msg#: 10135 posted 8:00 pm on Apr 27, 2005 (gmt 0)

HEY SPAN! i didn't give up, look at this code:
function printit()
{
document.getElementById("printButton").style.display='none';
if ((navigator.appName == "Netscape"))
{ window.print() ;
}
else
{
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
var nCopies = 4; //because i want to print it 4 times
for(x=0; x<=nCopies;x++)
{
document.body.insertAdjacentHTML('beforeEnd', WebBrowser); WebBrowser1.ExecWB(6,-1);
WebBrowser1.outerHTML = "";
}
}
}
I really don't know how it works but sends the printing directly and with the for u can send n copies.

hey, do you understand the code? because I don't know when the print is sending, you know I can't see any window.print just for netscape but i'm using IE, maybe is magic jajaja

Span

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 10135 posted 8:39 pm on Apr 27, 2005 (gmt 0)

Lol..

I understand half of the code, the ExecWB looks like VBScript and I know nothing of that. But I think you have to call the printit function with a button or link.

<a href="#" onclick="printit();" id="printButton">Print 4 copies.</a>

When clicking that link you call the printit() function. It hides the link and prints your page..
I'm on a Mac, so you have to test it yourself.

Reflection

10+ Year Member



 
Msg#: 10135 posted 10:19 pm on Apr 27, 2005 (gmt 0)

If you have a print style sheet it's as easy as:

div#hearder{display:none;}
div#footer{display:none;}

agilbull

10+ Year Member



 
Msg#: 10135 posted 12:47 pm on May 17, 2005 (gmt 0)

Hi,

How do you use
div#hearder{display:none;}
div#footer{display:none;}
to make IE header and footer disappear?

I think that
div#hearder{display:none;}
div#footer{display:none;}
are used to create html page without using <table>.

AgilBull

Robin_reala

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 10135 posted 1:27 pm on May 17, 2005 (gmt 0)

Reflection's talking about a header and footer contained in the page - everyone else seems to be talking about the data/time/page# stamps that IE puts in.

Reflection

10+ Year Member



 
Msg#: 10135 posted 6:15 pm on May 17, 2005 (gmt 0)

Sorry, my mistake, I misunderstood the original post.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved