示例#1
0
文件: Page.php 项目: chaimvaid/linet3
 /**
  * Prepare page to be rendered into PDF.
  *
  * @todo Don't forget to close all current graphics operations (like path drawing)
  *
  * @param Zend_Pdf_ElementFactory_Interface $objFactory
  * @throws Zend_Pdf_Exception
  */
 public function render(Zend_Pdf_ElementFactory_Interface $objFactory)
 {
     $this->flush();
     if ($objFactory === $this->_objFactory) {
         // Page is already attached to the document.
         return;
     }
     if ($this->_attached) {
         //require_once 'Zend/Pdf/Exception.php';
         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);
     }
 }
示例#2
0
 /**
  * Prepare page to be rendered into PDF.
  *
  * @todo Don't forget to close all current graphics operations (like path drawing)
  *
  * @param Zend_Pdf_ElementFactory_Interface $objFactory
  * @throws Zend_Pdf_Exception
  */
 public function render(Zend_Pdf_ElementFactory_Interface $objFactory)
 {
     $this->flush();
     if ($objFactory === $this->_objFactory) {
         // Page is already attached to the document.
         return;
     }
     if ($this->_attached) {
         #require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Page is attached to other documen. Use clone $page to get it context free.');
     } else {
         $objFactory->attach($this->_objFactory);
     }
 }
示例#3
0
文件: Proxy.php 项目: dalinhuang/popo
 /**
  * Attach factory to the current;
  *
  * @param Zend_Pdf_ElementFactory_Interface $factory
  */
 public function attach(Zend_Pdf_ElementFactory_Interface $factory)
 {
     $this->_factory->attach($factory);
 }
示例#4
0
 public function render(Zend_Pdf_ElementFactory_Interface $objFactory)
 {
     $this->flush();
     if ($objFactory === $this->_objFactory) {
         return;
     }
     if ($this->_attached) {
         throw new Zend_Pdf_Exception('Page is attached to other documen. Use clone $page to get it context free.');
     } else {
         $objFactory->attach($this->_objFactory);
     }
 }