Kbase 19568: JavaScript Code to Print from an HTML Page
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/5/2004 |
|
Status: Unverified
GOAL:
JavaScript code to print from an HTML page.
FIX:
This routine provides a routine that can be used to print an HTML document without clicking on the print button in the browser. Some users prefer to handle printing through code
The following code should be used as a reference to how printing from an HTML page can be done. The example must be modified for a particular situation. The routine is not supported in any way by Progress Technical Support. If any problems are encountered, please review the documentation:
<HTML>
<HEAD>
<TITLE>Ebi's Print Example</TITLE>
</HEAD>
<SCRIPT>
function imprime(){
window.print();
}
</SCRIPT>
<BODY onload="imprime()">
<BR>
<TABLE WIDTH="345" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD><FONT FACE="Verdana, Arial" SIZE="1" COLOR="#093F77">
<P>This example will pop-up the printer dialog box when is loaded into the browser.
You may modify this example to do it on a button summit or what ever you like.
The intention of this example is for Webspeed and/or Apptivity users to create
applications that allow to print HTML documents from the code without interacting
with the browser.
<BR></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>