Printing web page programmatically in .NET

uwking

Newcomer
Joined
Feb 10, 2004
Messages
8
Location
Ontario, Canada
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!
 
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
 
uwking said:
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
 
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.
 
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.

:)
 
Back
Top