/** * Prepare page to be rendered into PDF. * * @todo Don't forget to close all current graphics operations (like path drawing) * * @param Zend_Pdf_ElementFactory $objFactory * @throws Zend_Pdf_Exception */ public function render(Zend_Pdf_ElementFactory $objFactory) { $this->flush(); if ($objFactory === $this->_objFactory) { // Page is already attached to the document. return; } if ($this->_attached) { throw new Zend_Pdf_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); } }