當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Pdf_ElementFactory_Interface::newStreamObject方法代碼示例

本文整理匯總了PHP中Zend_Pdf_ElementFactory_Interface::newStreamObject方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Pdf_ElementFactory_Interface::newStreamObject方法的具體用法?PHP Zend_Pdf_ElementFactory_Interface::newStreamObject怎麽用?PHP Zend_Pdf_ElementFactory_Interface::newStreamObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Pdf_ElementFactory_Interface的用法示例。


在下文中一共展示了Zend_Pdf_ElementFactory_Interface::newStreamObject方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Object constructor.
  *
  * If resource is not a Zend_Pdf_Element object, then stream object with specified value is
  * generated.
  *
  * @param Zend_Pdf_Element|string $resource
  */
 public function __construct($resource)
 {
     $this->_objectFactory = Zend_Pdf_ElementFactory::createFactory(1);
     if ($resource instanceof Zend_Pdf_Element) {
         $this->_resource = $this->_objectFactory->newObject($resource);
     } else {
         $this->_resource = $this->_objectFactory->newStreamObject($resource);
     }
 }
開發者ID:bitExpert,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:17,代碼來源:Resource.php

示例2: __construct

 /**
  * Object constructor.
  *
  * If resource is not a Zend_Pdf_Element object, then stream object with specified value is
  * generated.
  *
  * @param Zend_Pdf_Element|string $resource
  */
 public function __construct($resource)
 {
     if ($resource instanceof Zend_Pdf_Element_Object) {
         $this->_objectFactory = $resource->getFactory();
         $this->_resource = $resource;
         return;
     }
     require_once 'Zend/Pdf/ElementFactory.php';
     $this->_objectFactory = Zend_Pdf_ElementFactory::createFactory(1);
     if ($resource instanceof Zend_Pdf_Element) {
         $this->_resource = $this->_objectFactory->newObject($resource);
     } else {
         $this->_resource = $this->_objectFactory->newStreamObject($resource);
     }
 }
開發者ID:namgiangle90,項目名稱:tokyobaito,代碼行數:23,代碼來源:Resource.php

示例3: flush

 /**
  * Dump current drawing instructions into the content stream.
  *
  * @todo Don't forget to close all current graphics operations (like path drawing)
  *
  * @throws Zend_Pdf_Exception
  */
 public function flush()
 {
     if ($this->_saveCount != 0) {
         //require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Saved graphics state is not restored');
     }
     if ($this->_contents == '') {
         return;
     }
     if ($this->_pageDictionary->Contents->getType() != Zend_Pdf_Element::TYPE_ARRAY) {
         /**
          * It's a stream object.
          * Prepare Contents page attribute for update.
          */
         $this->_pageDictionary->touch();
         $currentPageContents = $this->_pageDictionary->Contents;
         $this->_pageDictionary->Contents = new Zend_Pdf_Element_Array();
         $this->_pageDictionary->Contents->items[] = $currentPageContents;
     } else {
         $this->_pageDictionary->Contents->touch();
     }
     if (!$this->_safeGS && count($this->_pageDictionary->Contents->items) != 0) {
         /**
          * Page already has some content which is not treated as safe.
          *
          * Add save/restore GS operators
          */
         $this->_addProcSet('PDF');
         $newContentsArray = new Zend_Pdf_Element_Array();
         $newContentsArray->items[] = $this->_objFactory->newStreamObject(" q\n");
         foreach ($this->_pageDictionary->Contents->items as $contentStream) {
             $newContentsArray->items[] = $contentStream;
         }
         $newContentsArray->items[] = $this->_objFactory->newStreamObject(" Q\n");
         $this->_pageDictionary->touch();
         $this->_pageDictionary->Contents = $newContentsArray;
         $this->_safeGS = true;
     }
     $this->_pageDictionary->Contents->items[] = $this->_objFactory->newStreamObject($this->_contents);
     $this->_contents = '';
 }
開發者ID:chaimvaid,項目名稱:linet3,代碼行數:48,代碼來源:Page.php

示例4: newStreamObject

 /**
  * Generate new Zend_Pdf_Element_Object_Stream
  *
  * @todo Reusage of the freed object. It's not a support of new feature, but only improvement.
  *
  * @param mixed $objectValue
  * @return Zend_Pdf_Element_Object_Stream
  */
 public function newStreamObject($streamValue)
 {
     return $this->_factory->newStreamObject($streamValue);
 }
開發者ID:dalinhuang,項目名稱:popo,代碼行數:12,代碼來源:Proxy.php

示例5: flush

 /**
  * Dump current drawing instructions into the content stream.
  *
  * @todo Don't forget to close all current graphics operations (like path drawing)
  *
  * @throws Zend_Pdf_Exception
  */
 public function flush()
 {
     if ($this->_saveCount != 0) {
         throw new Zend_Pdf_Exception('Saved graphics state is not restored');
     }
     if ($this->_contents == '') {
         return;
     }
     if ($this->_pageDictionary->Contents->getType() != Zend_Pdf_Element::TYPE_ARRAY) {
         /**
          * It's a stream object.
          * Prepare Contents page attribute for update.
          */
         $this->_pageDictionary->touch();
         $currentPageContents = $this->_pageDictionary->Contents;
         $this->_pageDictionary->Contents = new Zend_Pdf_Element_Array();
         $this->_pageDictionary->Contents->items[] = $currentPageContents;
     } else {
         $this->_pageDictionary->Contents->touch();
     }
     $this->_pageDictionary->Contents->items[] = $this->_objFactory->newStreamObject($this->_contents);
     $this->_contents = '';
 }
開發者ID:vojtajina,項目名稱:sitellite,代碼行數:30,代碼來源:Page.php

示例6: setMetadata

    /**
     * Sets the document-level Metadata (mast be valid XMP document)
     *
     * @param string $metadata
     */
    public function setMetadata($metadata)
    {
        $metadataObject = $this->_objFactory->newStreamObject($metadata);
        $metadataObject->dictionary->Type    = new Zend_Pdf_Element_Name('Metadata');
        $metadataObject->dictionary->Subtype = new Zend_Pdf_Element_Name('XML');

        $this->_trailer->Root->Metadata = $metadataObject;
        $this->_trailer->Root->touch();
    }
開發者ID:nhp,項目名稱:shopware-4,代碼行數:14,代碼來源:Pdf.php


注:本文中的Zend_Pdf_ElementFactory_Interface::newStreamObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。