<html><head> <script language="JavaScript"> function function1() { window.print(); } </script> </head> <body> <p>Some body content to print</p> <input type="button" value="Print" onclick="function1()" onlayoutcomplete='alert("The preview layout process is finished")'> </body> </html>