dcsimg
Printing an applet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Frode_Laursen
Posted On:   Friday, February 15, 2002 03:34 AM

Hi, I have an HTML pag with an applet on it which I would like to print using the browser "print" button. The applet is written in java 1.1.8 so all browsers should be able to view it without an additional plugin. It displays fine on all platforms and versions of browser. But it only prints on unix Netscape 4.*, US version of IE 5.5 on win 2K (and older versions of IE), but not Japanese version of IE 5.5 SP2 (native JRE), and prints fine on win version of Netscape 4.*. It does however not print on IE 6* and Netscape 6*, neither using native JRE or Sun JVM. Though there is a difference in what they do print. The HTML prints fine and using IE 6* with MS jvm 5.5 some of the appl   More>>

Hi,


I have an HTML pag with an applet on it which I would like to print using the browser "print" button.


The applet is written in java 1.1.8 so all browsers should be able to view it without an additional plugin.


It displays fine on all platforms and versions of browser. But it only prints on unix Netscape 4.*, US version of IE 5.5 on win 2K (and older versions of IE), but not Japanese version of IE 5.5 SP2 (native JRE), and prints fine on win version of Netscape 4.*.


It does however not print on IE 6* and Netscape 6*, neither using native JRE or Sun JVM. Though there is a difference in what they do print. The HTML prints fine and using IE 6* with MS jvm 5.5 some of the applet prints, but not, it seems, the bits drawn using the awt paint methods (e.g.: drawRect() ).


All in all it seems as though printing is fien with all browsers that are "used to" java 1.1.... but this is a long shot.


My applet is just a wrapper around a comercial applet, and I would like to solve this without doing any changes to this commercial applet. My wrapper is has some functions dealing with layout and some minor details.


Does anyone have any suggestions as to what to do?


Best Regards


Frode

   <<Less

Re: Printing an applet

Posted By:   Christopher_Schultz  
Posted On:   Friday, February 15, 2002 05:07 AM

I'm pretty sure that when the browser "prints" your applet, it does so be re-painting it into an offscreen buffer.



Since this is the case, your paint() method should be able to render the whole applet, including the drawRect calls, etc.



If your code is already set up to do this, then I don't know what to tell you.



-chris
About | Sitemap | Contact