What is 'out' in you catch-phrase?
Is it a PrintWriter you got like this:
PrintWriter out = response.getPrintWriter()
Calling getOutputStream() after calling getPrintWriter()
is illegal. That is what I tried to explain in an earlier
mail...
Get rid of this PrintWriter and your code will work.
(Of course I am not clairvoyant; if this 'out' is just
System.err or System.out, there's probably something else
wrong).
Bruno
Quoting [EMAIL PROTECTED]:
> 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());
> }
-------------------------------------------------------
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