Hi,
the pdflib is a commercial library. But there is a lite version available (for non commercial use without PDI functions).
Either download the binary distribution that comes with a binary module for different PHP versions or do the following (change to a build directory of your choice, you don't need to recompile apache or php):
- Download PDFlib lite 6.0.1
- Install the pdflib with e.g.
./configure --prefix=/usr/local --with-gnu-ld --enable-large_files
make
make install
ldconfig
- Download the pdflib pecl extension
pear download pdflib
- Extract the archive
tar xzf pdflib-2.0.4.tgz
cd pdflib-2.0.4
- create configure files etc.
phpize
- configure and make
./configure --with-php-config=/path/to/php-config --with-pdflib=/usr/local
make
make install
Instead of make install, alternatively locate the pdf.so file in the pdflib-2.0.4 directory after executing make and copy the file to the extension directory.
7. enable the extension by adding the following line to php.ini
extension=pdf.so
8. restart apache
Important: If the PDF examples in the PHP documentation fail to run then try some of the examples that come with the pdflib lite. Seems like the function descriptions in the PHP manual aren't completely up-to-date.
Thomas