Hi Bruno,

I've got a similar problem.

I am using the spring framework and there is a class called 
AbstractPdfView to create PDFs with iText.
there is one method to create a PDF.

protected abstract void buildPdfDocument(Map model,
                                          com.lowagie.text.Document 
document,
                                          com.lowagie.text.pdf.PdfWriter 
writer,
                                          HttpServletRequest request,
                                          HttpServletResponse response)
                                   throws Exception

     Subclasses must implement this method to build an iText PDF 
document, given the model. Called between Document.open() and 
Document.close() calls.

     Note that the passed-in HTTP response is just supposed to be used 
for setting cookies or other HTTP headers. The built PDF document itself 
will automatically get written to the response after this method returns.

So I need a document to create a PDF.
How can I add the ByteArrayOutputStream Document


best regards

Peyman


Bruno Lowagie (iText) schrieb:
> Hello Sendil,
> you post a question: "how to create a PDF in memory"
> and then you answer it yourself: "with ByteArrayOutputStream".
> That's very odd.
> 
> This is an altered code snippet:
> ...
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> PdfStamper stamper = new PdfStamper(reader, baos);*
> ...
> stamper.close();
> baos.writeTo(response.getOutputStream());
> 
> br,
> Bruno
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to