I've got a grip of PDFs that I need to combine into one using PHP. Googling around gives me very little that seems like a reasonable solution. The best thing I can find is to use exec() and pdftk but that's just ugly. Does anyone know of a more elegant solution that doesn't involve me shelling out all the money on the planet for some non-free lib?
A:
http://www.setasign.de/products/pdf-php-solutions/fpdi/demos/concatenate-fake/
Make sure you have FPDF 1.6. This is what I tested with.
Regards.
mediaslave
2009-11-23 21:29:01
@neoneye do you have another solution that is PHP driven? pdftk is what I would call a reliable solution using PHP's exec() function.
mediaslave
2010-09-09 14:55:30
A:
You could utilize a PHP/Java bridge to get access to iText.
Actually, the homepage of the bridge component has an example with concatenation of PDFs.
Jørn Schou-Rode
2009-11-23 21:33:46
A:
Not sure if there is a pure PHP-based solution, because exec()
is really not that ugly as you might think. As an alternative for pdftk
you can use Ghostscript:
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf header.pdf example.pdf
sanmai
2009-11-24 04:47:06