Name

Introduction to extensions

Description

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

Writing extensions is relatively straightforward. The basic steps are:

  1. Copy the 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.
  2. Edit the class name to match the filename.
  3. Add the functionality you need to the class.

There are very few requirements phppdflib makes of an extension, they are:

The following recommendations apply to extensions, but are not requirements:

Examples

See Also

The documentation for the particular extension you are using

History

The first extension was charting, which was added in 2.1

Bugs

Sure to be some.