Jeff, As a last resort, you could write the pdf to a temporary directory accessible via apache, then send the browser a redirect to that file. That way, the actual PDF will be served by apache, not Tomcat. You'll obviously have to tidy up the generated PDFs periodically, although the temp file methods in java.io.File should help. Also, java.util.Timer is useful for writing jobs which do clean up tasks.
This is of course undesirable, but sometimes you just have to do what it takes to make something work... :-( Good luck, Andy > -----Original Message----- > From: Jeff Larsen [mailto:[EMAIL PROTECTED]] > Sent: 14 May 2002 17:01 > To: [EMAIL PROTECTED] > Subject: REPOST: Problems serving PDF to Netscape browsers > > > I've made no progress on this, so let's try again. My dynamic > PDF is working perfectly with MSIE 4, 5, and 6, but I'm still > having problems with Netscape (ver 4 and 6) and the Acrobat > (ver 4 and 5) plugin. I've tried this on various client machines. > > With both NS4 and NS6, I just get a blank screen when I request > my dynamic PDF. They don't even show the Acrobat toolbar. The > similarities end there. > > In NS4, the first request does not launch the AcroRd32.exe > process. In fact, it fails to read the entire output of the > servlet and Tomcat (4.0.3) spits out a Broken Pipe exception > to the logs. If I hit "Reload", however, I get my PDF and the > plugin works. According to the Apache logs, the first unsucessful > request returns 6144 of 21212 bytes before the broken pipe. On > the "Reload", the Apache log shows TWO requests returning the > full 21212 bytes and Netscape displays it in the plugin. > > In NS6, the first request DOES launch the plugin executable, but > that's as far as it gets. "Reload" doesn't help. My Apache server > reports the correct number of bytes for the full PDF request, so the > data seems to be getting to the browser. No exceptions are thrown > by Tomcat. > > In both NS4 and NS6, it works if I configure Acrobat to be launched > as an external application instead of a plugin. But it is not a > viable option to impose that configuration on our customers. > > I use a servlet mapping that sends requests for xxx.pdf to my > servlet, thus the browser sees a ".pdf" filename. I also use > setContentType("application/pdf"). There are known problems > with MSIE and unknown ContentLength with PDF so I create the > PDF in a ByteArrayOutputStream so I can know and set the > ContentLength before writing to response.getOutputStream(). > > To take the dynamic nature of the PDF out of the equation, I was > able to reproduce these problems --sometimes-- when serving static > PDF files via Tomcat. > > > ----- Original Message ----- > From: "Jeff Larsen" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, May 09, 2002 1:44 PM > Subject: Problems serving PDF to Netscape browsers > > > > I'm running out of hair to pull out here... > > > > My ultimate goal is to serve dynamically generated > > PDF documents generated with iText. I've got it working > > just fine with MSIE. However, I was just getting blank > > pages with Netscape (and it wasn't even showing the toolbar > > for Acrobat). With NS6 I could at least see that it started > > an AcroRd32.exe process, but NS4 didn't even get that far. > > > > So, I did some tests to rule out some variables. I grabbed > > a handful of pre-generated PDF files and stuck them on > > my Apache 1.3.23 server. All browsers could display the > > PDFs just fine. Then I set up Tomcat 4.0.3 to server the > > same files directly without going through Apache. MSIE worked, > > but both NS browsers gave a blank page with no Acrobat plugin > > toolbar. Again NS6 managed to start an Acrobat process, NS4 > > didn't. > > > > My production environment is Apache 1.3.23 and Tomcat 4.0.3 > > connected with mod_jk. > > > > > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
