Jim Hurricane wrote:
> Hi Bruno,
> 
> I'm assuming you mean to create the new ByteArrayOutputStream when the 
> writer is created (instead of the FileOutputStream to create the PDF 
> disk-based file), right?

No.
I mean to create the ByteArrayOutputStream as explained
in the book, tutorial and every web app sample that uses
iText.

> So, my question then is what object would actually hold the BAOS when 
> the code is done?

Document document = new document();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfWriter.getInstance(document, baos);
document.open();
// add stuff to the document
document.close();

now the object baos holds the BAOS.
If there's a problem with that, I don't understand it.

> If I create the BAOS as you suggested, I'm not sure how I'd get a hold 
> of the BAOS when the code is done. Perhaps, I'm not extracting the BAOS 
> in the right part of the code?

Please read a tutorial example using a ByteArrayOutputStream first.
http://itextdocs.lowagie.com/tutorial/general/webapp/#HelloWorld
Also have a look at the Javadoc API for ByteArrayOutputStream.
There's even a method that returns a byte[].
br,
Bruno

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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