SeanH
asked on
Printing in HTML
We're using IE4.01, and need to print ASP-generated HTML documents. Our problem is that they are legal documents and cannot have the standard printed HTML header and footer (i.e. the page address and page number).
How can this be done?
How can this be done?
If you want the print to be exact, generate Adobe PDF and have the users print THAT instead!
I'd go with kschang suggestion.
Not a bad dig, SaGS, it's IE only, but may be usable for Intranet.
Try this example and see if this helps you in any way..
It has some text on the screen with a print button...you press the print button and it prints everything on the page....in this case it would be the text..
For your case you put the asp in the place of the html text.
<HTML>
<HEAD>
<script>
function print_ms()
{
var OLECMDID_PRINT = 6;
var OLECMDEXECOPT_DONTPROMPTUS ER = 2;
var OLECMDEXECOPT_PROMPTUSER = 1;
//print webpage with no prompt
WebBrowser1.ExecWB(OLECMDI D_PRINT, OLECMDEXECOPT_DONTPROMPTUS ER);
}
</script>
</HEAD>
<BODY>
<!ie browser object used for printing>
<Object ID="WebBrowser1" Width="0" Height="0"
ClassID="CLSID:8856F961-34 0A-11D0-A9 6B-00C04FD 705A2"></O bject>
Hello world!
<input type=button value="Print page" onclick="print_ms() ">
</BODY>
</HTML>
Let me know if this helps.
It has some text on the screen with a print button...you press the print button and it prints everything on the page....in this case it would be the text..
For your case you put the asp in the place of the html text.
<HTML>
<HEAD>
<script>
function print_ms()
{
var OLECMDID_PRINT = 6;
var OLECMDEXECOPT_DONTPROMPTUS
var OLECMDEXECOPT_PROMPTUSER = 1;
//print webpage with no prompt
WebBrowser1.ExecWB(OLECMDI
}
</script>
</HEAD>
<BODY>
<!ie browser object used for printing>
<Object ID="WebBrowser1" Width="0" Height="0"
ClassID="CLSID:8856F961-34
Hello world!
<input type=button value="Print page" onclick="print_ms() ">
</BODY>
</HTML>
Let me know if this helps.
ASKER
SaGS. Cool link, that's exactly the kind of thing I was looking for! We can't use PDF since we need to generate some of the document on the fly, but ScriptX looks perfect.
Fire off an answer.
Thanks.
Fire off an answer.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not a lot of help I know.