Installing PDFLib and PHP with PDF Support
Requirements
- PHP 4.02+ from http://php.net
- PDFLib 3.0.1 from http://www.pdflib.com
This is a little recipe to get PDFlib 3.0.1 working with PHP4:
-
download PHP directly from http://php.net
Uwe Steinman patched ext/pdf/pdf.c to support PDFLib v 3.0.1 -
download PDFLib 3.0.1 from http://www.pdflib.com
- apply every patch you find at http://www.pdflib.com/pdflib/patches.html
- Configure, Make & install PDFLib
#./configure –enabled-shared-pdflib
#make
#make install
You’ll get PDFLib installed in /usr/local/lib .
-
Configure PHP
#./configure --with-apxs=/usr/bin/apxs --with-gd --with-pdflib=/usr/local --with-mysql=/usr/local --with-config-file-path=/etc/httpd --with-zlib-dir=/usr --with-ttf=/usr/local/include --with-jpeg-dir=/usr --with-tiff-dir=/usr --with-system-regex=yes --enable-debug=no #make #make install
-
Update System Library
Insert /usr/local/lib in /etc/ld.so.conf #/sbin/ldconfig
-
Test & Hack
Now you need to restart Apache#apachectl restart
Copy pdfclock.php in your httpd directory… test… and That’s all.
Important Notes
To get working PDFLib with fonts you must pay attention to the UPR section of the PDFLib manual.
A simple way to use fonts with PDFLib is to copy the standard UPR description file included in PDFLib tarball,
(fonts/pdflib.upr) into your working directory.
A simple way to use fonts with PDFLib is to copy the standard UPR description file included in PDFLib tarball,
(fonts/pdflib.upr) into your working directory.