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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing a page to print 3 times

Status
Not open for further replies.

TonyU

Technical User
Feb 14, 2001
1,317
US
[tt]
How would I force a webpage to print 3 times?
I have this "Receipt" page that displays after an order has been submitted but users need it to print 3 times before closing it and I'm not sure how to do so, Thanks in advance.

Currently I have user select file print but would like to have a link to print it.
[tt]"A Successful man is one who can build
a firm foundation with the bricks
that others throw at him"
[/tt]

star.gif
star.gif
star.gif
star.gif

 
This is an option they should be able to choose when the print dialog comes up, I am not sure you can set the number of times for it to print from script, you may want to dig into the MSDN library for the print dialog object to see if there is a property so that you can set the default number of copies to 3 rather than 1. After getting the VBScript way to do it, the javascript function/property setting should be either exactly the same or extremely similar.
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
[tt]
Thanks for the response Tarwn, but in this case, we need to have 3 pages print at all times everytime no choices about it.

And I'm sure it can be done with javascript, I'll check with the folks there. thanks.
[tt]"A Successful man is one who can build
a firm foundation with the bricks
that others throw at him"
[/tt]

star.gif
star.gif
star.gif
star.gif

 
what u do u open a window without showing close button u provide a close button on the window where user clicks to close before closing the form u can check how many time users have print the form whaterver.

bye

prasad
 
[tt]
Sorry, but I have no idea what you just said.
[tt]"A Successful man is one who can build
a firm foundation with the bricks
that others throw at him"
[/tt]

star.gif
star.gif
star.gif
star.gif

 
I've looked through the MSDN library and they are saying that the calls to the page setup box to change things such as number of copies, default printer, and so on are not exposed to client side scripting. Here is a thought however. Why not create a hidden inner frame or div and write the contents of the the receipt to that space three times. You can insert a paragraph tag in between them with a style attribute of "pageBreakAfter: always;" so that each would have a page break between them (Each would start on a new page). Then call the framename.print() from your script and as long as the user hits the ok button then they will have 3 copies of the receipt.
A bit ugly, but should work. You may need to re-work it a little depending on browser type.
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top