Title: RE: [iText-questions] Update on Creating PDF via Servlet

I don't know anything about any other servlets, but I use the following code in  servlet environment.  I may, however, not understand your question/setup enough for this to be useful.

<code>
response.setContentType("application/pdf");
ByteArrayOutputStream pdfout = new ByteArrayOutputStream();

//construct pdf here
       
response.setContentLength(pdfout.size());
pdfout.writeTo(response.getOutputStream());
response.flushBuffer();
response.getOutputStream().close();
</code>


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 01, 2003 9:00 AM
> To: [EMAIL PROTECTED]
> Subject: [iText-questions] Update on Creating PDF via Servlet
>
>
> I have gotten the generation of the PDF dynamically to
> work to a certain extent for my own application and
> was wondering if anyone might be able to help.  So far
> here's how I got it to work.  I had to change inline
> to attachment and the attachment made it work, inline
> just kept displaying the byte code.  Secondly, I'm not
> sure if it's because I'm using a cached image (don't
> think it should be, prolly the cache control even when
> I commment it out) but once I see the PDF once as the
> attachment, when I try to again it gives me an error.
> Any ideas on why this won't work and why inline
> wouldn't work?  What I am doing is passing the
> ByteArrayOutputStream from one JSP to another and then
> using the logic from Sean's servlet in the called JSP.
>  Any help would be appreciated, thank you.
>
> -Tom Schneider
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_06
> 1203_01/01
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>

Reply via email to