/** * Rollback document $steps number of revisions. * This method must be invoked before any changes, applied to the document. * Otherwise behavior is undefined. * * @param integer $steps */ public function rollback($steps) { for ($count = 0; $count < $steps; $count++) { if ($this->_trailer->getPrev() !== null && $this->_trailer->getPrev()->Root !== null) { $this->_trailer = $this->_trailer->getPrev(); } else { break; } } $this->_objFactory->setObjectCount($this->_trailer->Size->value); // Mark content as modified to force new trailer generation at render time $this->_trailer->Root->touch(); $this->pages = array(); $this->_loadPages($this->_trailer->Root->Pages); }