I tried as below
try {
response.setContentType("application/pdf");
//out.println("First Line");
Document document=null;
ByteArrayOutputStream ba =null;
document = new Document();
ba = new ByteArrayOutputStream();
PdfWriter.getInstance(document, ba);
document.open();
document.add(new Paragraph("Hello World"));
document.close();
response.setContentLength(ba.size());
ServletOutputStream out1 = response.getOutputStream();
ba.writeTo(out1);
out1.flush();
}
catch(Exception e) {
out.println(e.getMessage());
}
but still I am getting IllegalStateException > I am using IE 6.0.
Server is JRun
[EMAIL PROTECTED] wrote
Quoting [EMAIL PROTECTED]:
> I tried this method. After I create the PDF file I redirect the response to
> the pDF file created then I create the file Object delete this file, File
> gets deleted first before redirecting the response to the PDF file.
Isn't this what you expected?
Contrary to politics and religion, some things
in the world do obey elementary logic ;-)
What you need to do is redirect the responce NOT to the
actual file, but to a Servlet who 'serves' the file and
deletes it after it is sent to the client.
Bruno
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions