Introduction to extensions
Extensions are part of the phppdflib that are probably not used by everyone. They are thus implemented in an "on demand" way that prevents them from tying up memory when not used.
The technical explanation is: They are stored in a seperate class file that included only when enabled.
From the user's standpoint, the extension is enabled by a
$pdf->enable('extensionname')
call, and its methods are
accessed with calls like $pdf->extensionname->methodname()
or $pdf->x['extensionname']->methodname()
.
Writing extensions is relatively straightforward. The basic steps are:
examples/extension.class.php
extension template
to the name you want your extension to have. Put it in the same
directory as phppdflib.class.php
.
There are very few requirements phppdflib makes of an extension, they are:
$pdf
.
This variable will be a reference back to the main phppdflib object,
and can (and should) be used by the extension to access the methods
of phppdflib.
The following recommendations apply to extensions, but are not requirements:
The documentation for the particular extension you are using
The first extension was charting, which was added in 2.1
Sure to be some.