Manages the revisions of a PDF document.
A PDF document has one revision when it is created. Later, new revisions are added when changes are made. This allows for adding information/content to a PDF file without changing the original content.
The order of the revisions is important. In HexaPDF the oldest revision always has index 0 and the newest revision the highest index. This is also the order in which the revisions get written.
See: PDF1.7 s7.5.6, HexaPDF::Revision
Public Class Methods
Creates a new revisions object for the given PDF document.
An array of revisions that should initially be used. If this option is not specified, a single empty revision is added.
The parser with which the initial revisions were read. If this option is not specified even though the document was read from an IO stream, some parts may not work, like incremental writing.
Public Instance Methods
Adds a new empty revision to the document and returns it.
Returns the current revision.
Deletes a revision from the document, either by index or by specifying the revision object itself.
Returns the deleted revision object, or
nil if the index was
out of range or no matching revision was found.
Regarding the index: The oldest revision has index 0 and the current revision the highest index!
Iterates over all revisions from oldest to current one.
Merges the revisions specified by the given range into one. Objects from newer revisions overwrite those from older ones.
Returns the revision at the specified index.