Load pdflib in php on demand

301 Views Asked by At

I use pdfLib for creating PDF in PHP, The problem here is until now i used pdflib version 8 Currently i need to use vector images in pdf, which is not supported in pdflib version 8 ,

So i want to use PDFlib version 9 which supports vector image, I need to install pdflib version 9 not remove pdflib version 8, so that other projects are not disturebed.

1) Is there a way to Install two versions of PdfLib?
2) Can we load pdlib version 9 dynamically in PHP.
1

There are 1 best solutions below

0
On

Jup, there is one:

Load PDFlib at runtime with one of the following lines at the start of your script:

dl("libpdf_php.so"); # for Unix
dl("libpdf_php.dll"); # for Windows

Source: http://www.pdflib.com/fileadmin/pdflib/pdf/manuals/PDFlib-8.0.6-tutorial.pdf 2.10 PHP Binding

For additional checks if its loaded or not, theres the method extension_loaded().