How to print from a web page

sridharb

New member
Joined
Feb 15, 2006
Messages
3
Programming Experience
5-10
Hello All,

I have a problem in printing from a web page, i want the exact syntax for printing from a webpage.
 
You cannot automatically print from a web page. The Java Script to cause the Print Dialog to come up is:

VB.NET:
============================================================
Script:     Print Current Window From A Link
Function:   Opens printer dialogue to print current page
Browsers:   Version 4 and later (others degrade gracefully)
Author:     etLux
============================================================

Step 1.
Put the following script in the head of your page.

<script>

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header

function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}


</script>

============================================================

Step 2.
Put the following in the body of your page.

<a href="javascript:printWindow()">Print This Page</a>

============================================================
 
Back
Top