So I'm having a problem opening/saving my generated PDF in Internet Explorer
7 on a remote host. Basically, I click on my button to generate the PDF, it
then sends the data to my servlet that generates the document and then sends
it back in a response. When I do via localhost everything works the way its
supposed to, I get the document to open in IE. However if I try this from
another machine, the document doesn't open; when tried in Firefox remotely
everything works. So I then started down the road of reviewing my response
headers and haven't had any luck.
resp.setContentType("application/pdf");
resp.setContentLength(document.size());
resp.setHeader("Pragma", "no-cache");
resp.setHeader("Expires", "-1");
resp.setHeader("Accept-Ranges", "bytes");
resp.setHeader("Content-disposition", "inline; filename=report.pdf");
OutputStream outputStreamToClient = resp.getOutputStream();
document.writeTo(outputStreamToClient);
try {
outputStreamToClient.flush();
outputStreamToClient.close();
} catch (Exception e) {
if (DEBUG) {
System.out.println(e.getMessage());
}
}
My next step was to run a wireshark trace and verify that I was in fact
getting my generated document sent to the remote machine and I was able to
confirm the response was in fact sent and that all my necessary headers were
in place. I'm open to any suggestions; I've even tried setting the response
headers to the exact ones from the iText tutorial to no avail.
Matt
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/