My preferred way would be to create ByteArrayOutputStreams and then concatenate 
them. Do you provide any tools with iText for concatenating the 
ByteArrayOutputStreams? 

I have seen in the book that you use Concat.main(arguments) where arguments is 
a String array for the pdf file names - so as far as I understand I wouldn't be 
able to use that when working with ByteArrayOutputStreams. 
Alternatively in the book I have seen how you can use PDFReaders and PDFCopy 
but I can only see how that does it on a page by page basis.   

Thanks for your help.

>There are different ways to achieve this.

>You could create the PDFs in memory by writing to a 
>ByteArrayOutputStream instead of to a FileOutputStream, then when you 
>are finished concatenate them.

>Or you could add the TOC at the end of the file, and then reorder the 
>pages as explained in the book: http://1t3xt.be/?X000012



Katrina Walker wrote:
> Hi,
>
> I am trying to produce a pdf with a table of contents at the start of 
> the pdf. The problem I have is that the table of contents can only be 
> populated once all the content has been processed (due to existing 
> codebase).  I am currently using a com.lowagie.text.Document for the 
> table of contents and then a com.lowagie.text.Document for the 
> content. I was wondering if there is a way to concatenate the two 
> Documents and then create the PDF as opposed to creating two PDF's and 
> concatenating them.
>
> Thanks
> Kat Walker
>
>
>

*********************************************************************
Please note that:

1. This e-mail may constitute privileged information. If you are not the 
intended recipient, you have received this confidential email and any 
attachments transmitted with it in error and you must not disclose, copy, 
circulate or in any other way use or rely on this information.
2. E-mails to and from the company are monitored for operational reasons and in 
accordance with lawful business practices.
3. The contents of this email are those of the individual and do not 
necessarily represent the views of the company.
4. The company does not conclude contracts by email and all negotiations are 
subject to contract.
5. The company accepts no responsibility once an e-mail and any attachments is 
sent.
http://www.integralis.com
*********************************************************************



------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to