/** * Prepare page to be rendered into PDF. * * @todo Don't forget to close all current graphics operations (like path drawing) * * @param \Zend\Pdf\ObjectFactory $objFactory * @throws \Zend\Pdf\Exception */ public function render(ObjectFactory $objFactory) { $this->flush(); if ($objFactory === $this->_objFactory) { // Page is already attached to the document. return; } if ($this->_attached) { throw new Exception('Page is attached to one documen, but rendered in context of another.'); /** * @todo Page cloning must be implemented here instead of exception. * PDF objects (ex. fonts) can be shared between pages. * Thus all referenced objects, which can be modified, must be cloned recursively, * to avoid producing wrong object references in a context of source PDF. */ //... } else { $objFactory->attach($this->_objFactory); } }