Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 05-30-2008, 08:13 PM Printing problem
Junior Talker

Posts: 3
Trades: 0
Hi,

I'm developing a web application for our company and i hit a wall with the printing feature.

What I need is something like this: if the user presses a button, two copies of the current page (of course, with separate css for print media) will be printed out on the default printer. And there must not be any other content generated by the browsers (headers like the url, page title, page 1 of x, etc).

Is there any way to achieve this functionality? Right now all i can do is pop up the printing dialog with a simple javascript command, but thats unacceptable...
McDouglas is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-30-2008, 08:16 PM Re: Printing problem
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
In your print css file, you can specify what to hide and what to show for print purposes.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-30-2008, 08:25 PM Re: Printing problem
Junior Talker

Posts: 3
Trades: 0
You can only apply CSS formatting to HTML elements. The header/footer that your browser adds is not a HTML element (though they affect them indirectly).


You can find those header settings in FF: File->Page setup-> MArgins & Header/Footer (if i remember around the same place in IE)
McDouglas is offline
Reply With Quote
View Public Profile
 
Old 05-31-2008, 01:26 AM Re: Printing problem
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
You can have it print twice using javascript: http://www.javascript-page.com/printpage.html just repeat the window.print(). Where it prints is not up to the browser but rather the user. The browser will print using the print css file most likely. If you don't want a header maybe use a blank title?
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 06-03-2008, 04:50 PM Re: Printing problem
Junior Talker

Posts: 3
Trades: 0
Quote:
Originally Posted by Arenlor View Post
You can have it print twice using javascript: http://www.javascript-page.com/printpage.html just repeat the window.print(). Where it prints is not up to the browser but rather the user. The browser will print using the print css file most likely. If you don't want a header maybe use a blank title?

Unfortunately window.print() will just pop up the print window. The user have to set the copies to 2 and hit the actual print button.

Default printer is set for a reason... so applications can chose it without asking the user.

Also, a blank title will only eliminate 1 of the 4 header fields. Page 1 of X, the url and the date is still present :\


And yes, the browser will use the css assigned for the printer, thats not a problem.
McDouglas is offline
Reply With Quote
View Public Profile
 
Old 06-04-2008, 12:12 AM Re: Printing problem
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
The page 1 of X, the url, and the date are things added by the printer itself, not the browser. I use Lynx at time (it's text only) along with old versions of some browsers which don't allow typed css files, in these cases it wouldn't print the correct CSS. So unless you can force a single standardized setup for all your users which includes changing the printer settings to not print the extra information, then you're going to have to accept the few things out of your control.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Reply     « Reply to Printing problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.64917 seconds with 12 queries