tags:

views:

173

answers:

2

I'm using FOP to generate PDF files.

What's the best way to either include another PDF file in a PDF generated by FOP or to cook multiple PDF files together using PHP?

A: 

i would suggest you either use some commandline tool e.g. http://sourceforge.net/projects/pdfsam/ or combine the pdfs using the fpdi class - http://www.setasign.de/products/pdf-php-solutions/fpdi/

roman
+1  A: 

After creation with FOP, as kind of post-processing, I'd suggest to take a look at the PDF toolkit. In it's own words:

If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a simple tool for doing everyday things with PDF documents.

I used this in some projects where I needed to re-sort FOP's output into a printable page order.

Unfortunately it's neither Java nor PHP, but it's useful in so many ways, that I think it needs mentioning nonetheless. And it's a small standalone, that you can perhaps simply set in your server's path...

Boldewyn