CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 How to printout without prompting dialog box

Print topic Send  topic

Author Message
Erdal
Posted: 03/21/2003, 2:08 AM

How to printout without prompting dialog box

Thanks
RonB
Posted: 03/21/2003, 2:47 AM

I don't thinks that's psossible under windows. Security measure.
Erdal CYCEK
Posted: 03/21/2003, 7:39 AM

This code print it without promting dialog box

'enter a body section
<DIV align=center><!----------------------------------------- START DEMONSTRATION HERE --------->
<SCRIPT language=Javascript>


function printit(){
if (NS) {
window.print() ;
} else {
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
}
}
</SCRIPT>

<SCRIPT language=Javascript>
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');
}
</SCRIPT>
<!----------------------------------------- END DEMONSTRATION HERE ---------></DIV>

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.