Link to home
Start Free TrialLog in
Avatar of SeanH
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?
Avatar of Steves2001
Steves2001

If this is a company intranet, you will have to configure to print preferences on the users browser, if it is across the internet you may have to resort to a set of instructions for the users.

Not a lot of help I know.
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_DONTPROMPTUSER = 2;
var OLECMDEXECOPT_PROMPTUSER = 1;

//print webpage with no prompt
WebBrowser1.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER);
}
</script>
</HEAD>
<BODY>

<!ie browser object used for printing>
<Object ID="WebBrowser1" Width="0" Height="0"
ClassID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></Object>


Hello world!

<input type=button value="Print page" onclick="print_ms() "> 

</BODY>
</HTML>


Let me know if this helps.
Avatar of SeanH

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.
ASKER CERTIFIED SOLUTION
Avatar of SaGS
SaGS

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial