User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,647 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,374 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 38813 | Replies: 11
Reply
Join Date: Sep 2004
Posts: 24
Reputation: chunguy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
chunguy's Avatar
chunguy chunguy is offline Offline
Newbie Poster

No page header and footer when printing a web page

  #1  
Dec 13th, 2004
hihi,

is there a way to rid of the page header (usually it's the page title and url) and the page footer (usually it's the page number and date) without having user to change from the web browser's the page setup ?

Can this be done using javascript or just html meta tags?

Also we control the contents of what is printed from a web page without having to redirect the page? Example, I have three paragraphs on a web page and I don't want the middle paragraph to be printed.

thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: No page header and footer when printing a web page

  #2  
Dec 13th, 2004
Research the CSS Print Profile: http://www.w3.org/TR/2004/CR-css-print-20040225/
Reply With Quote  
Join Date: Sep 2004
Posts: 24
Reputation: chunguy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
chunguy's Avatar
chunguy chunguy is offline Offline
Newbie Poster

Re: No page header and footer when printing a web page

  #3  
Dec 15th, 2004
hi,

thanks for your reference given but i still can't get it rite. i tested by including this in a cascading style sheet.

@page {
@top-left{
font-family: Helvetica, Arial, sans-serif;
font-size: 18pt;
font-weight: bolder;
content: "XHTML-Print: A Proposal --- August 25, 2000";
}
}
by right, this should print out "XHTML-Print: A Proposal --- August 25, 2000" on the top left of the page right. but it doesn't. This is just testing. Anyway, my problem is I want to get rid of the header and footer without having to change it using the page setup of the browser. by the way, i'm using mozilla browser.

please help.
Reply With Quote  
Join Date: Sep 2004
Posts: 24
Reputation: chunguy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
chunguy's Avatar
chunguy chunguy is offline Offline
Newbie Poster

Re: No page header and footer when printing a web page

  #4  
Dec 22nd, 2004
anyone have any idea whether we can eliminate the headers and footers with PHP ? or any other languages ?
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: No page header and footer when printing a web page

  #5  
Dec 23rd, 2004
The headers and footers are put there by your printing subsystem, not by the page or the browser. What that means is, this particular attribute is in the hands of the user. Much like screen resolution or brower width. I always find it irritating when programmers try to override my perceived control.
Reply With Quote  
Join Date: Sep 2004
Posts: 24
Reputation: chunguy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
chunguy's Avatar
chunguy chunguy is offline Offline
Newbie Poster

Re: No page header and footer when printing a web page

  #6  
Dec 25th, 2004
hi tgreer,

thanks for your time and info so far. sorry, if anything i asked irritated you.
I've got further questions though. If lets say i'm doing a web application (using PHP) in a closed environment, when a user submit a form for example, the info is sent to the server. On the server, the necessary processing is done and the content is sent by the server to the right printer to print. How do I get about to do this?

In this case can the page to print be processed automatically without the header and footer before being sent to printer ?
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: No page header and footer when printing a web page

  #7  
Dec 25th, 2004
Don't misunderstand me, your POST didn't irritate me at all.

Your server can print to a printer attached to the server. You can't force something to print on the users printer.

The headers and footers are put there by the operating system's printing subsystem. It's not something you can control with a scripting language.
Reply With Quote  
Join Date: Sep 2004
Posts: 24
Reputation: chunguy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
chunguy's Avatar
chunguy chunguy is offline Offline
Newbie Poster

Re: No page header and footer when printing a web page

  #8  
Dec 26th, 2004
ok tgreer. i get the point with the header and footer now.

any tips on how i can select which printer to print on the server using scripting language or any other related languages?
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: No page header and footer when printing a web page

  #9  
Dec 28th, 2004
You're posting this in the JavaScript/DHTML forum. To control the printer on the server, you would have to use a server-side language. Which server-side language do you know?
Reply With Quote  
Join Date: Sep 2004
Posts: 24
Reputation: chunguy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
chunguy's Avatar
chunguy chunguy is offline Offline
Newbie Poster

Re: No page header and footer when printing a web page

  #10  
Dec 28th, 2004
initially, i had hoped this could be done with javascript, so i posted the question here. Anyway, I did post a similar question in the PHP forum at this link http://www.daniweb.com/techtalkforums/thread15881.html .

I know ASP and PHP but on this assignment I have to use PHP. So, ... PHP it is.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:15 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC