uwking Posted April 26, 2004 Posted April 26, 2004 Hello all, I am trying to programmatically print the current web page when I press a button. I currently have the code as below, which uses the javascript print command. ------------------------------------------------------------- btnPrint.Attributes.Add("onclick", "javascript:window.print();"); ------------------------------------------------------------- but this command brings up Print Dialog. I do NOT want to see the print dialog. All I want to do is when the user press the print button, it prints the current web page twice. How can I do that? I am not sure how to use PrintDocument for web pages instead of files. Thanks for reading this! Quote
Arch4ngel Posted April 26, 2004 Posted April 26, 2004 At my knowledge... it's not possible to directly print something without the approval of the user. What if it were permitted ? Did you ever think the number of spam that your printer would be printing ? :p So... I someone know how... (and if it's possible)... don't reveal that to spammer :p Stay Zen Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
MorningZ Posted April 26, 2004 Posted April 26, 2004 Hello all, I am trying to programmatically print the current web page when I press a button. I currently have the code as below, which uses the javascript print command. ------------------------------------------------------------- btnPrint.Attributes.Add("onclick", "javascript:window.print();"); ------------------------------------------------------------- but this command brings up Print Dialog. I do NOT want to see the print dialog. All I want to do is when the user press the print button, it prints the current web page twice. How can I do that? I am not sure how to use PrintDocument for web pages instead of files. Thanks for reading this! It is not the Javascript code there bringing up the "Print Dialog", it is 100% the user's Operating System doing so...... you cannot code around it, it is not within a programmer's control Quote If you make it idiot proof, they'll build a better idiot :-)
Arch4ngel Posted April 27, 2004 Posted April 27, 2004 It relly on Windows... not on browser. All you can do is showing the Print Dialog. You could maybe do something like printing but... the only way I see is by ActiveX component. Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
uwking Posted April 27, 2004 Author Posted April 27, 2004 Thanks for sharing your info Thanks guys so, it is impossible to create a webpage on which there is a button the user can click to print the current webpage for a certain number of times? Oh well, if you says so. Thanks for sharing your info. :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.