NAME
PDF::Objind - PDF indirect object reference. Also acts as an abstract superclass for all elements in a PDF file.
INSTANCE VARIABLES
Instance variables differ from content variables in that they all start with a space.
- parent
-
The file context for this object. That is the object that keeps track of all the objects in the file (whether reading or writing).
- objnum (R)
-
The object number
- objgen (R)
-
The object generation
There are other instance variables which are used by the parent for file control.
- loc (P)
-
This holds the read and then the write location of the actual object in the file.
- isfree
-
This marks whether the object is in the free list and available for re-use as another object elsewhere in the file.
- nextfree
-
Holds a direct reference to the next free object in the free list.
METHODS
PDF::Objind->new($parent, $number, $generation)
Creates a new object reference with given parent, number and generation. Note that subclasses do not necessarily have the same creation parameters. This may seem naughty, but allows subclasses to be sub-objects of another object, or objects in their own right (with their own number and generation).
$r->val
Returns (number, generation) which if used in a scalar context results in just the number.
$r->outobjdeep($fh)
If this is a real object rather than just a sub-object, then output this object with its object header to filehandle. Notice that it is up to the subclass to output the endobj at the end.
$r->outobj($fh)
If this is a full object then outputs a reference to the object, otherwise calls outobjdeep to output the contents of the object at this point.
$r->outxref($fh)
Outputs cross-reference information for this object (if it has any) to the cross-reference table.
$r->elementsof
Abstract superclass function filler. Returns self here but should return something more useful if an array.
$r->isobj($number, $generation)
Marks this simple object (sub-object) as a full object in its own right. Involves informing the parent that this thing is now a full object, and to make sure that it is output next time.
$r->empty
Empties all content from this object to free up memory or to be read to pass the object into the free list. Simplistically undefs all instance variables other than object number and generation.
$r->merge($objind)
This merges content information into an object reference place-holder. This occurs when an object reference is read before the object definition and the information in the read data needs to be merged into the object place-holder
$r->is_obj($parent)
Returns whether this object is a full object with its own object number or whether it is purely a sub-object. $parent may optionally be set to a different parent than the object thinks it is. I'm not sure about this.
$r->copy($res)
Returns a new copy of this object. The object is assumed to be some kind of associative array and the copy is a deep copy for elements which are not PDF objects, and shallow copy for those that are. Notice that calling copy
on an object forces at least a one level copy even if it is a PDF object. The returned object loses its PDF object status though.
If $res is defined then the copy goes into that object rather than creating a new one. It is up to the caller to bless $res, etc. Notice that elements from $self are not copied into $res if there is already an entry for them existing in $res.