cPdfWriter Image_Graph Driver
Published on December 17th, 2014 under Software ProjectsGo to download page
for source and binary files.
PHP5 Image_Graph driver for PDF export without using PDFlib. This is LGPL software.
To use this driver you must have previously installed the PEAR package, also you need to install the Image_Graph package, and of course the cPdfWriter library above. You must install those first. These are some advantages of this driver over the PDFlib one included with Image Graph:
- Supports gradient fills
(all types except MIRRORED which are translated to RADIAL)!
- Supports image fills
(supports JPG, PNG(removes alpha) and GIF(removes transparency) formats)!
- Supports transparency
(alpha-blending)!
- It’s LGPL so it’s free, even for commercial use :)!
Some examples from the Image_Graph website rendered with this driver (version 0.2!!!):
ver2-1.pdf, ver2-2.pdf, ver2-3.pdf, ver2-4.pdf, ver2-5.pdf
Notes:
To use this driver copy it in the Image_Canvas directory. This could be “/usr/share/pear/Image/Canvas/“ but it might differ for you. Then use it just as you would use any Image_Graph driver, i.e.:
include_once ‘Image/Graph.php’;
include_once ‘Image/Canvas.php’;
$Canvas =& Image_Canvas::factory(’CPDFWRITER’,
array(’width’ => 600,’height’ => 400));
$Graph =& Image_Graph::factory(’graph’, &$Canvas);
…
Enjoy!