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?
So, my question then is what object would actually hold the BAOS when the
code is done?
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?
I did try to create one where I defined the ByteArrayOutputStream outside
the writer creation code (in R&J example) then put the reference to the BAOS
inside the writer creation code.
But, at the end of the code, there was still nothing in the BAOS. My goal
was to have a reference to the object (BAOS defined, and instantiated, at
the class level) that I could reference (with a filled-in BAOS) when the
code was done.
I must be missing something....
Look forward to your reply..
Thanks again.
- M
From: "Bruno Lowagie (iText)" <[EMAIL PROTECTED]>
Reply-To: Post all your questions about iText here
<[email protected]>
To: Post all your questions about iText here
<[email protected]>
Subject: Re: [iText-questions] BAOS in one step?
Date: Mon, 21 May 2007 10:08:28 +0200
Jim Hurricane wrote:
> Sorry, I guess my question wasn't clear...
>
> I'm trying to see if there's a simple change that can be made to the
> Romeo & Juliet Example that will let you output to a baos instead of to
> a physical file. If not, I already have the code that reads the PDF into
> a BAOS and returns it to the browser.
You are referring to the example in chapter 14 of the book:
http://itext.ugent.be/itext-in-action/chapter.php?chapter=14
As explained in chapter 2, iText can write PDF to any OutputStream.
In the example, a file is written to:
new FileOutputStream("romeo_juliet.pdf")
But you could easily replace this with baos, where baos is constructed
like this: ByteArrayOutputStream baos = new ByteArrayOutputStream();
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/
_________________________________________________________________
PC Magazines 2007 editors choice for best Web mailaward-winning Windows
Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_pcmag_0507
-------------------------------------------------------------------------
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/