Embodies one revision of a PDF file, either the initial version or an incremental update.
The purpose of a
Revision object is to manage the objects and the trailer of one revision. These objects can either be added manually or loaded from a cross-reference section or stream. Since a PDF file can be incrementally updated, it can have multiple revisions.
If a revision doesn't have an associated cross-reference section, it wasn't created from a PDF file.
See: PDF1.7 s7.5.6,
The callable object responsible for loading objects.
The trailer dictionary
Public Class Methods
Creates a new
XRefSectionobject that contains information on how to load objects. If this option is specified, then a
loaderor a block also needs to be specified!
The loader object needs to respond to
calltaking a cross-reference entry and returning the loaded object. If no
xref_sectionis supplied, this value is not used.
If a block is given, it is used instead of the loader object.
Public Instance Methods
Adds the given object (needs to be a
HexaPDF::Object) to this revision and returns it.
Deletes the object specified either by reference or by object number from this revision by marking it as free.
mark_as_free option is set to
false, the object is really deleted.
Calls the given block for every object of the revision, or, if
true, for every already loaded object.
Objects that are loadable via an associated cross-reference section but are currently not loaded, are loaded automatically if
Calls the given block once for each object that has been modified since it was loaded. Deleted object and cross-reference streams are ignored.
Note that this also means that for revisions without an associated cross-reference section all loaded objects will be yielded.
Returns the next free object number for adding an object to this revision.
Returns the object for the given reference or object number if such an object is available in this revision, or
If the revision has an entry but one that is pointing to a free entry in the cross-reference section, an object representing PDF null is returned.
true if the revision contains an object
for the exact reference if the argument responds to :oid, or else
for the given object number.
Updates the stored object to point to the given
HexaPDF::Object wrapper, returning the object if successful or
obj isn't stored in this revision or the stored object doesn't contain the same
HexaPDF::PDFData object as the given object, nothing is done.
This method should only be used if the wrong wrapper class is stored (e.g. because auto-detection didn't or couldn't work correctly) and thus needs correction.