tags:

views:

344

answers:

3

I have three PDF files. The first is a hand-craft marketing cover for a book, the second is rendered content from a DocBook --> XSLT --> FOP --> PDF process, and the third is some back cover content. Looking for the best way to concatenate these three PDFs into a single PDF. Anyone have any suggestions?

+1  A: 

Here is a free JAVA library that supports concatenation of PDF files: http://www.lowagie.com/iText/

Gdeglin
Thanks, so iText it is.
tobrien
+2  A: 

If you are willing to call out to an external program (itself written in Java with iText I believe), then Pdftk is ideal for this. It will probably be easier than learning an API.

jhs
+1  A: 

Merging in iText can be tricky. Especially if the PDF files contain form fields. My recommendation is to read the GPL'd source code from PDF Split and Merge aka pdfsam.

Specifically look at the execute() method in the PdfConcat class.

JonMR