G'day fellow iText users.

I have recently joined the long list of web page developers battling 
with the IE bug/feature that causes the "cannot write to cache" error 
when downloading PDF files from one of my sites.


I realise that this is not really an iText issue but iText users have 
obviously spent a lot of time trying to find a work-around and might be 
able to help me.

I have tried all of the suggestions that I can find but with no avail.

The critical part of the scenario at this particular site seems to be an 
IChains server that converts all HTTP traffic to HTTPS. There is no way 
that the site will allow me to bypass that box.

As part of it's processing of (at least iText generated) PDFs, it seems 
to add a Pragma: no-cache header which in turn causes IE to barf.

The interesting thing is that I can download previously created PDF 
files from this site without any problem - but with slightly different 
code.

Can anybody please explain why the following two code snippets should
give such different results?

Cheers and thanks,
Stephen Davies

PDF file code:
          bfile = new java.io.File(sid);
          blob = new java.io.FileInputStream(bfile);
          httpservletresponse.setContentType(s1);
          httpservletresponse.setContentLength((int)bfile.length());
          ServletOutputStream servletoutputstream = 
httpservletresponse.getOutputStream();
          byte abyte0[] = new byte[8192];
          int l = blob.read(abyte0);
          if(l == 0)
          {
                return;
          }
          servletoutputstream.write(abyte0, 0, l);
          while((l = blob.read(abyte0)) != -1)
              servletoutputstream.write(abyte0, 0, l);


iText PDF code:

                PdfWriter.getInstance(doc, baos);
                doc.open();
                .....
                doc.close();
                httpservletresponse.setContentType("application/pdf");
                httpservletresponse.setContentLength(baos.size());
                ServletOutputStream pout = 
httpservletresponse.getOutputStream();
                baos.writeTo(pout);
                pout.flush();


-- 
========================================================================
This email is for the person(s) identified above, and is confidential to
the sender and the person(s).  No one else is authorised to use or
disseminate this email or its contents.

Stephen Davies Consulting                            Voice: 08-8177 1595
Adelaide, South Australia.                             Fax: 08-8177 0133
Computing & Network solutions.                       Mobile:0403 0405 83

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to