Friday, May 28, 2004

Print from a web page without a dialog box

This is bad practice, as far as I'm concerned. Sometimes you just have to do what you have to do though.

You may be required to tweak your browser security settings to allow ActiveX downloads to get it completely transparent, so tread carefully.

<title>Title of your print test page.</title>
function Print()
if (document.all)
WebBrowser1.ExecWB(6, 6) //use 6, 1 to prompt the print dialog or 6, 6 to omit it;
WebBrowser1.outerHTML = "";


<div style="page-break-before:always">
<p>This would be your page text.</p>

<object ID="WebBrowser1" WIDTH="0" HEIGHT="0"




No comments:

Post a Comment