views:

532

answers:

3

Will have 50-100 single PDF's that we'll be generating with a php script. PDF's are generally grouped into groups of 10-20. Each group needs to have it's own Table of Contents or Index, and then there also needs to be a Master Table of Contents or Index at the beginning.

Or if that is too difficult we could get away with a single Table of Contents at the beginning.

What's the best way to go about this?

Will we need to create the Table of Contents and then export that to PDF and append it to the beginning and mash the rest of the files after that? Or is there a better solution?

And what's the best tool for us to merge the pdf's?

Will be running on a Linux server.

+6  A: 

And what's the best tool for us to merge the pdf's?

On linux distributions you can install an useful little program, pdftk. It works well to bind PDF's together. For example:

$ pdftk in1.pdf in2.pdf in3.pdf in4.pdf in5.pdf in6.pdf cat output out.pdf

where in*.pdf are the input files and out.pdf is the result.

Federico Ramponi
A: 

To simplify the process of generating table of contents for PDF files, I've successfully generated LaTeX code from php and then used latex2pdf to generate the PDF file.

Maybe this could be an alternative, in your case.

To merge PDFs, I agree with Federico that pdftk is the best solution.

Roberto Aloi
A: 

If you can use PDF bookmarks instead of a table of Contents page you can use pdfrecycle to merge the PDF files and create the bookmarks.

Florian Diesch