Generate a PDF file in PHP

While developing recently, I have to transform automatically pictures in a PDF file using a script in PHP.

After a quick search on google, I easily found a software (and his lib) Image Magick – http://www.imagemagick.org/
Seemed quite the fit, I was thinking it was perfect, until I try to run it on my dev environment : WAMP, yes on windows.

I checked everything like installation of the software in a matching version (x86 or x64), different DLL available for PHP : http://pecl.php.net/package/imagick
But never get this thing worked, the software run smoothly, but the lib never load in PHP. I’ve paid attention to architectural versions, compiler and even secured threads or not.

So I resigned myself to use this lib and got my way to find an alternative that suits me more and a lot easier to use : a PHP class named FPDF. You import it really easily in your script and the examples on the website cover perfectly my needs, I recommend it to you if, like me, you encountered a lot of problems while using Imagick on a windows environment.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.