if the sample is accurate below, the byte array is constructed before the
close().

Swap 'em.

-----Original Message-----
From: Paulo Soares [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 20, 2002 12:06 PM
To: NGUYEN LIEM (APP1LXN); [EMAIL PROTECTED]
Subject: Re: [iText-questions] RE: Create PDF In Memory


What's the problem of getting the pdf document from ByteArrayOutputStream
after close()?

Best Regards,
Paulo Soares

----- Original Message -----
From: "NGUYEN LIEM (APP1LXN)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 16:44
Subject: [iText-questions] RE: Create PDF In Memory


> > Hi Everyone,
> >
> > Can you tell me how to build a PDF Document in memory. If I use
> > ByteArrayOutputStream to create OutputStream and pass this
> outputStream to
> > PdfWriter.getInstance, then I can have a PDF Document in memory.
> However,
> > after building the document, I have to call document.close() and in
> the
> > tutorial, It said calling document.close() will flush and close the
> > outputstream to which the writer is writing. I have tried to get the
> PDF
> > Document from my ByteArrayOutputStream  before call document.close()
> but
> > what I get is an uncompleted document.
> >
> > (Concat.java)
> >
> > ...
> > Document document = new Document(reader.getPageSizeWithRotation(1));
> > ByteArrayOutputStream pdfOutputStream = new ByteArrayOutputStream();
> > PdfWriter writer = PdfWriter.getInstance(document, pdfOutputStream);
> >
> > ....
> >
> > byte [] tempPDF = pdfOutputStream.toByteArray();
> > document.close(); // this will close my ByteArrayOutputStream (???)
> >
> >
> > Do you have any idea,
> >
> > Thanks
> >
> > Liem
> >
> >
> >
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: OSDN - Tired of that same old
> cell phone?  Get a new here for FREE!
> https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to