phppdflib uses several data structures and methods that are hidden from the average programmer who is using the library. That does not mean that these structures and methods are of no use to the average implementer, it's mainly that accessing them violates the design goal of "simplicity" and abstracting the PDF format from the implementer.
In the interest of documentation completeness, as well as the possibility that these structures and methods were made private by some error of the developers, they are documented briefly here. If you find something that you feel should be made a public method and more fully documented, don't hesitate to email your case to me.
The most interesting data structure is the ->objects array.
This is where all PDF objects are stored prior to
->generate()
being called.
While the library methods that access this (most all of them) use it in an "append-only/read-only" fashon, it is possible to modify the attributes of pre-existing library objects by directly altering its contents.
The array is arranged such that the first index is the ID of
the object, and the next is the parameter of that object to access.
The array may have additional indicies for certain parameters
(color, for example, which is an array of red, green, and blue
values). Thus $pdf->objects[4]['type']
will return
the type of object #4 ('rectangle', for example) and
$pdf->objects[4]['width']
will return the line width
with which that rectange will be drawn.
Prior to calling ->generate()
it is possible to
alter the ->objects array to change how objects occur. Doing so
without understing ->objects is liable to create a corrupt PDF
or cause ->generate()
to fail. See the source.
Returns a mode number suitable for inserting directly into
the final PDF stream from the applicable part of the array
parameters
. type
indicates the type
of element that will be using this mode (i.e. text or shape)
Adjusts the cordinates for the margins on the specified page
Takes a parameters array and returns a complete parameters array
with default values substituted where needed. textmode
controls how the painting modes are interpreted.
Pushes an error onto the message stack.
Pushes an error onto the message stack as defined by
errornumber
. Use to debloat the code by having common
error message stored centrally.
Oddly, I'm not sure what this does. Could be code bloat.
Check to see if a requested font is already in the list, if not add it. Either way, return the libid of the font.
Convert a big-endian byte stream into an integer.
Returns the binary data to embed into the PDF for the given image.
Returns the binary data to embed into the PDF for the given image placement.
Returns proper PDF code to specify a rotation angle.
Returns the proper character to tell PDF to perform an operation on a shape (i.e. stroke, fill, whatever)
Returns code appropriate for the PDF to create a line from the library object.
Returns code appropriate for the PDF to create a rectangle from the library object.
Returns code appropriate for the PDF to create a circle from the library object.
Returns code appropriate for the PDF to create a text object from the library object.
Returns a string to set the apropriate stroke and fill colors for an object.
Returns true if the library object converts to a PDF object. (this is almost definately code bloat that needs cleaned up)
Creates a PDF array of child objects of the given object.
Builds an array of pages for the given pagenode in the correct order.
simple helper function to return the current oid and increment it by one.
Add an object to the xref table data structure with the given offset and generation number.
Returns a properly formatted pdf dictionary containing entries specified by the array $entries.
Returns a properly formatted pdf array.
Returns a properly formatted string, with any special characters escaped.
Creates a properly formatted PDF "stream" object.
If specified, the items in entries
are
added to the dictionary part of the stream.
Returns a properly formatted page node.
Creates a PDF page. The calling syntax is a bit bloated, it could probably work with just the libraryID.