Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Re: Print Api


Message #1 by Hari Yellina <hyellina@k...> on Fri, 1 Sep 2000 00:26:27 -0500
Try this


<script language="JavaScript">
<!--
var NS4 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion)
>= 4);
function
tIt(){  
   if (NS4 != 1) {
       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>
<a href="#" onClick="printIt()"><img src="printer.gif" width="75" height="45" align="right" border="0"></a>

********************************************************************************************************************

Hope it helps.

Gonzalo Ruiz de Villa
Área de Desarrollo
Adesis Netlife 
www.adesis.com


-----Mensaje original-----
De: Hari Yellina [mailto:hyellina@k...]
Enviado el: viernes, 01 de septiembre de 2000 7:26
Para: Pro_JavaServer_Pages
Asunto: [pro_jsp] Re: Print Api

Thanks, the answer is very clear. But does any one have code can they can provide to me?

Thanking you.

> ----------
> From:         Steve Holmes[SMTP:SteveHolm@j...]
> Sent:         Thursday, August 31, 2000 9:36 PM
> To:   Pro_JavaServer_Pages
> Subject:      [pro_jsp] Re: Print Api
>
> An HTML page can be printed using javascript from the client or of course
> the browser always has the option to print.  A JSP page acts just like a
> normal HTML page from the browser so you can have the same functionality.
> The print API is intended for Java GUIs and not for HTML pages that are
> already supported by javascript.
> Good Luck!  I hope that was helpful,
> Steve
>
> ___________________
> Steve Holmes
> Web Developer
> Jones & Stokes
> steveholm@j...
>  xxx-xxx-xxxx  ext: 3200
>
> >>> hyellina@k... 08/31/2000 2:26:24 AM >>>
> Does any one can help with me the print api. I am unable to find it. My
> page
> is not a applet oridanry JSP generated Html page. I have to print it.
>
> Please Help



  Return to Index