iText5.4.0 - Java version
I have the 2007 iText in Action text and I'm reading through chapter 17 where
it talks about using the ByteArrayOutputStream in web applications. I see the
examples in the text show generating a pdf using a servlet and all the plumbing
takes place in the servlet (PdfWriter, creating the document, adding content,
etc...)
I'm looking for some general design advice. My web interface is a JSF 2.0
facelets template. My first attempt at jumping out of the JSF lifecycle to
display a pdf was to create a bean (as a singleton) that holds the values for
the pdf I'm trying to generate, and then populate that bean from the model and
then from the servlet get an instance of that bean to populate the pdf cells.
But I would really like to generate the pdf in the model using the
ByteArrayOutputStream method described in the text. Then I can simply write
that output stream to the ServletOutputStream and then I don't have to populate
a bean for the sake of holding data for the pdf.
Is this the wrong approach?
I have a need to generate a pdf from roughly 40+ GIS datasets, which use
cursors that one has to iterate over to get results, and I have access to all
of those in the model. The reason I ask about the ByteArrayOutputStream is
that on one of the pages, the author alludes to using this approach as a
"pity", which makes me wonder if it is a huge performance hit? Trying to
understand that comment.
Leo
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php