O.K. this has been hashed over thousands of times, but I am sure that this used to work, but now it's not. I am trying to view dynamically created pdfs with IE (in my case ie 6.0 and acrobat reader 6.0)

my code requires that a servlet be called as a POST and supply some parameters for generating the pdf file. the code that actually returns the pdf from the servlet looks like:

[code]

byte[] pdf;
try
{
        pdf = runReports (lots, of, parameters, go, here);
}
catch (DocumentException de)
{
        throw new ServletException(de.getMessage());
}
response.setContentType("application/pdf");
response.setContentLength(pdf.length);
ServletOutputStream out = response.getOutputStream();
out.write(pdf);
out.close();

[/code]

and the response from the server looks like:

[code]

HTTP/1.1 200 OK
Date: Thu, 06 Nov 2003 18:36:14 GMT
Server: (IIOP/1.1 Connector)
Set-Cookie: CP_GUTC=10.19.235.134.1068143774786220; path=/; expires=Mon, 30-Oct-28 18:36:14 GMT; domain=domain.removed.to.protect.the.guilty
content-type: application/pdf
content-length: 2072
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: No-cache
Cache-Control: no-cache
Connection: close


%PDF-1.4

-- pdf content clipped --

%%EOF

[/code]

Everything looks fine, but IE will not show the pdf in the browser. If AcrobatReader is configured to not show PDFs in the browser, all is well.

I've read the FAQ and this looks to conform to those suggestions.

The interesting thing is that the exact same code running on my local server works with no problems (different dataset, so the content is a different size).

It's response looks like:

[code]

HTTP/1.1 200 OK
Date: Thu, 06 Nov 2003 18:52:04 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b DAV/1.0.2 PHP/4.1.2 mod_perl/1.26 mod_jk/1.1.0
Content-Length: 2097
Connection: close
Content-Type: application/pdf


%PDF-1.4

-- pdf content clipped --

%%EOF

[/code]

So, maybe it's one of the additional headers added by the borland app server that's causing IE the problems?

Set-Cookie:
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: No-cache
Cache-Control: no-cache

any IE gurus out there have any idea if one of these headers is confusing IE?

-jason



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to