Hi

I need to do a PDF containing the following
- A TOC showing page numbers and being clickable
- the content, mainly chapters and sections, with sections having a
"Back to TOC" link
- an index, which takes actors of my content and say : Actors Bal : on
page 2 and page 3.

Currently, the content is grabbed from an XML file, but that's not the
current issue (it would rather be this one :
http://www.nabble.com/Best-way-to-go-for-automating-PDF-creation---td22543559.html
)

Currently, the way I'm doing it is the following (well almost, some
bits are still missing, but that the way I'll follow) :
- I use a modified ChapterEvents which add a named destination called
TOC after each section, as well as register chapter/section titles and
page number
- I use IndexEvents for the index part, based as well on local goto
and page number
- when all the content is parsed, I first create a new pdf with only
the TOC, to know how many pages it'll do (adding manually a chapter
for the index). I store this number
- I then create a new page, add the named destination TOC, and the
chapter/section titles, pages number (each one added of the TOC number
of page) and links
- I move the pages corresponding to the TOC at the beginning
(reordering the pages)
- I finally add the index and its links, still adding the number of
page of the TOC to the page numbers I've stored

Is it a better way to do it ?

The example document I'm trying to reproduce is 800Ko large (including
TOC, content and index), would it be problematic to proceed the way I
do with such large doc ?

Thanks in advance for your replies

cheers
zedros

------------------------------------------------------------------------------
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