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


PHP Zend_Pdf_Element_Object類代碼示例

本文整理匯總了PHP中Zend_Pdf_Element_Object的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Pdf_Element_Object類的具體用法?PHP Zend_Pdf_Element_Object怎麽用?PHP Zend_Pdf_Element_Object使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: dumpAction

 /**
  * Dump Action and its child actions into PDF structures
  *
  * Returns dictionary indirect object or reference
  *
  * @internal
  * @param Zend_Pdf_ElementFactory $factory   Object factory for newly created indirect objects
  * @param SplObjectStorage $processedActions  list of already processed actions (used to prevent infinity loop caused by cyclic references)
  * @return Zend_Pdf_Element_Object|Zend_Pdf_Element_Reference   Dictionary indirect object
  */
 public function dumpAction(Zend_Pdf_ElementFactory_Interface $factory, SplObjectStorage $processedActions = null)
 {
     if ($processedActions === null) {
         $processedActions = new SplObjectStorage();
     }
     if ($processedActions->contains($this)) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Action chain cyclyc reference is detected.');
     }
     $processedActions->attach($this);
     $childListUpdated = false;
     if (count($this->_originalNextList) != count($this->next)) {
         // If original and current children arrays have different size then children list was updated
         $childListUpdated = true;
     } else {
         if (!(array_keys($this->_originalNextList) === array_keys($this->next))) {
             // If original and current children arrays have different keys (with a glance to an order) then children list was updated
             $childListUpdated = true;
         } else {
             foreach ($this->next as $key => $childAction) {
                 if ($this->_originalNextList[$key] !== $childAction) {
                     $childListUpdated = true;
                     break;
                 }
             }
         }
     }
     if ($childListUpdated) {
         $this->_actionDictionary->touch();
         switch (count($this->next)) {
             case 0:
                 $this->_actionDictionary->Next = null;
                 break;
             case 1:
                 $child = reset($this->next);
                 $this->_actionDictionary->Next = $child->dumpAction($factory, $processedActions);
                 break;
             default:
                 require_once 'Zend/Pdf/Element/Array.php';
                 $pdfChildArray = new Zend_Pdf_Element_Array();
                 foreach ($this->next as $child) {
                     $pdfChildArray->items[] = $child->dumpAction($factory, $processedActions);
                 }
                 $this->_actionDictionary->Next = $pdfChildArray;
                 break;
         }
     } else {
         foreach ($this->next as $child) {
             $child->dumpAction($factory, $processedActions);
         }
     }
     if ($this->_actionDictionary instanceof Zend_Pdf_Element_Dictionary) {
         // It's a newly created action. Register it within object factory and return indirect object
         return $factory->newObject($this->_actionDictionary);
     } else {
         // It's a loaded object
         return $this->_actionDictionary;
     }
 }
開發者ID:kokx,項目名稱:zf-library,代碼行數:69,代碼來源:Action.php

示例2: newObject

 /**
  * Generate new Zend_Pdf_Element_Object
  *
  * @todo Reusage of the freed object. It's not a support of new feature, but only improvement.
  *
  * @param Zend_Pdf_Element $objectValue
  * @return Zend_Pdf_Element_Object
  */
 public function newObject(Zend_Pdf_Element $objectValue)
 {
     $obj = new Zend_Pdf_Element_Object($objectValue, $this->_objectCount++, 0, $this);
     $this->_modifiedObjects[$obj->getObjNum()] = $obj;
     return $obj;
 }
開發者ID:mtday,項目名稱:timesheet-system,代碼行數:14,代碼來源:ElementFactory.php

示例3: attachAnnotation

 /**
  *
  * @param Zend_Pdf_Annotation $annotation
  * @return Zend_Pdf_Page
  */
 public function attachAnnotation(Zend_Pdf_Annotation $annotation)
 {
     $annotationDictionary = $annotation->getResource();
     if (!$annotationDictionary instanceof Zend_Pdf_Element_Object && !$annotationDictionary instanceof Zend_Pdf_Element_Reference) {
         $annotationDictionary = $this->_objFactory->newObject($annotationDictionary);
     }
     if ($this->_pageDictionary->Annots === null) {
         $this->_pageDictionary->touch();
         $this->_pageDictionary->Annots = new Zend_Pdf_Element_Array();
     } else {
         $this->_pageDictionary->Annots->touch();
     }
     $this->_pageDictionary->Annots->items[] = $annotationDictionary;
     $annotationDictionary->touch();
     $annotationDictionary->P = $this->_pageDictionary;
     return $this;
 }
開發者ID:chaimvaid,項目名稱:linet3,代碼行數:22,代碼來源:Page.php

示例4: newObject

 /**
  * Generate new Zend_Pdf_Element_Object
  *
  * @todo Reusage of the freed object. It's not a support of new feature, but only improvement.
  *
  * @param Zend_Pdf_Element $objectValue
  * @return Zend_Pdf_Element_Object
  */
 public function newObject(Zend_Pdf_Element $objectValue)
 {
     #require_once 'Zend/Pdf/Element/Object.php';
     $obj = new Zend_Pdf_Element_Object($objectValue, $this->_objectCount++, 0, $this);
     $this->_modifiedObjects[$obj->getObjNum()] = $obj;
     return $obj;
 }
開發者ID:par-orillonsoft,項目名稱:Magento,代碼行數:15,代碼來源:ElementFactory.php

示例5: testDump

 public function testDump()
 {
     $factory = new Zend_Pdf_ElementFactory(1);
     $intObj = new Zend_Pdf_Element_Numeric(100);
     $obj = new Zend_Pdf_Element_Object($intObj, 55, 3, $factory);
     $this->assertEquals($obj->dump($factory), "55 3 obj \n100\nendobj\n");
 }
開發者ID:jsnshrmn,項目名稱:Suma,代碼行數:7,代碼來源:ObjectTest.php

示例6: setText

 /**
  * Set text to be displayed for the annotation or, if this type of annotation
  * does not display text, an alternate description of the annotation’s contents
  * in human-readable form.
  *
  * @param string $text
  * @return Zend_Pdf_Annotation
  */
 public function setText($text)
 {
     if ($this->_annotationDictionary->Contents === null) {
         $this->_annotationDictionary->touch();
         $this->_annotationDictionary->Contents = new Zend_Pdf_Element_String($text);
     } else {
         $this->_annotationDictionary->Contents->touch();
         $this->_annotationDictionary->Contents->value = new Zend_Pdf_Element_String($text);
     }
     return $this;
 }
開發者ID:robeendey,項目名稱:ce,代碼行數:19,代碼來源:Annotation.php

示例7: setText

 /**
  * Set text to be displayed for the annotation or, if this type of annotation
  * does not display text, an alternate description of the annotation’s contents
  * in human-readable form.
  *
  * @param string $text
  * @return Zend_Pdf_Annotation
  */
 public function setText($text)
 {
     require_once 'Zend/Pdf/Element/String.php';
     if ($this->_annotationDictionary->Contents === null) {
         $this->_annotationDictionary->touch();
         $this->_annotationDictionary->Contents = new Zend_Pdf_Element_String($text);
     } else {
         $this->_annotationDictionary->Contents->touch();
         $this->_annotationDictionary->Contents->value = new Zend_Pdf_Element_String($text);
     }
     return $this;
 }
開發者ID:andrelsguerra,項目名稱:pequiambiental,代碼行數:20,代碼來源:Annotation.php

示例8: __construct

 /**
  * Object constructor
  *
  * @param mixed $val
  * @param integer $objNum
  * @param integer $genNum
  * @param Zend_Pdf_ElementFactory $factory
  * @param Zend_Pdf_Element_Dictionary|null $dictionary
  * @throws Zend_Pdf_Exception
  */
 public function __construct($val, $objNum, $genNum, Zend_Pdf_ElementFactory $factory, $dictionary = null)
 {
     parent::__construct(new Zend_Pdf_Element_Stream($val), $objNum, $genNum, $factory);
     if ($dictionary === null) {
         $this->_dictionary = new Zend_Pdf_Element_Dictionary();
         $this->_dictionary->Length = new Zend_Pdf_Element_Numeric(strlen($val));
         $this->_streamDecoded = true;
     } else {
         $this->_dictionary = $dictionary;
         $this->_streamDecoded = false;
     }
 }
開發者ID:Yaoming9,項目名稱:Projet-Web-PhP,代碼行數:22,代碼來源:Stream.php

示例9: touch

 /**
  * Mark object as modified, to include it into new PDF file segment.
  *
  * We don't automate this action to keep control on PDF update process.
  * All new objects are treated as "modified" automatically.
  */
 public function touch()
 {
     if ($this->_parentObject !== null) {
         $this->_parentObject->touch();
     }
 }
開發者ID:chaimvaid,項目名稱:linet3,代碼行數:12,代碼來源:Element.php

示例10: dumpOutline

 /**
  * Dump Outline and its child outlines into PDF structures
  *
  * Returns dictionary indirect object or reference
  *
  * @internal
  * @param Zend_Pdf_ElementFactory    $factory object factory for newly created indirect objects
  * @param boolean $updateNavigation  Update navigation flag
  * @param Zend_Pdf_Element $parent   Parent outline dictionary reference
  * @param Zend_Pdf_Element $prev     Previous outline dictionary reference
  * @param SplObjectStorage $processedOutlines  List of already processed outlines
  * @return Zend_Pdf_Element
  * @throws Zend_Pdf_Exception
  */
 public function dumpOutline(Zend_Pdf_ElementFactory_Interface $factory, $updateNavigation, Zend_Pdf_Element $parent, Zend_Pdf_Element $prev = null, SplObjectStorage $processedOutlines = null)
 {
     if ($processedOutlines === null) {
         $processedOutlines = new SplObjectStorage();
     }
     $processedOutlines->attach($this);
     if ($updateNavigation) {
         $this->_outlineDictionary->touch();
         $this->_outlineDictionary->Parent = $parent;
         $this->_outlineDictionary->Prev = $prev;
         $this->_outlineDictionary->Next = null;
     }
     $updateChildNavigation = false;
     if (count($this->_originalChildOutlines) != count($this->childOutlines)) {
         // If original and current children arrays have different size then children list was updated
         $updateChildNavigation = true;
     } else {
         if (!(array_keys($this->_originalChildOutlines) === array_keys($this->childOutlines))) {
             // If original and current children arrays have different keys (with a glance to an order) then children list was updated
             $updateChildNavigation = true;
         } else {
             foreach ($this->childOutlines as $key => $childOutline) {
                 if ($this->_originalChildOutlines[$key] !== $childOutline) {
                     $updateChildNavigation = true;
                     break;
                 }
             }
         }
     }
     $lastChild = null;
     if ($updateChildNavigation) {
         $this->_outlineDictionary->touch();
         $this->_outlineDictionary->First = null;
         foreach ($this->childOutlines as $childOutline) {
             if ($processedOutlines->contains($childOutline)) {
                 require_once 'Zend/Pdf/Exception.php';
                 throw new Zend_Pdf_Exception('Outlines cyclyc reference is detected.');
             }
             if ($lastChild === null) {
                 // First pass. Update Outlines dictionary First entry using corresponding value
                 $lastChild = $childOutline->dumpOutline($factory, $updateChildNavigation, $this->_outlineDictionary, null, $processedOutlines);
                 $this->_outlineDictionary->First = $lastChild;
             } else {
                 // Update previous outline dictionary Next entry (Prev is updated within dumpOutline() method)
                 $childOutlineDictionary = $childOutline->dumpOutline($factory, $updateChildNavigation, $this->_outlineDictionary, $lastChild, $processedOutlines);
                 $lastChild->Next = $childOutlineDictionary;
                 $lastChild = $childOutlineDictionary;
             }
         }
         $this->_outlineDictionary->Last = $lastChild;
         if (count($this->childOutlines) != 0) {
             $this->_outlineDictionary->Count = new Zend_Pdf_Element_Numeric(($this->isOpen() ? 1 : -1) * count($this->childOutlines));
         } else {
             $this->_outlineDictionary->Count = null;
         }
     } else {
         foreach ($this->childOutlines as $childOutline) {
             if ($processedOutlines->contains($childOutline)) {
                 require_once 'Zend/Pdf/Exception.php';
                 throw new Zend_Pdf_Exception('Outlines cyclyc reference is detected.');
             }
             $lastChild = $childOutline->dumpOutline($factory, $updateChildNavigation, $this->_outlineDictionary, $lastChild, $processedOutlines);
         }
     }
     return $this->_outlineDictionary;
 }
開發者ID:Yaoming9,項目名稱:Projet-Web-PhP,代碼行數:80,代碼來源:Loaded.php

示例11: __construct

 /**
  * Object constructor
  *
  * @param mixed $val
  * @param integer $objNum
  * @param integer $genNum
  * @param Zend_Pdf_ElementFactory $factory
  * @throws Zend_Pdf_Exception
  */
 public function __construct($val, $objNum, $genNum, Zend_Pdf_ElementFactory $factory)
 {
     parent::__construct(new Zend_Pdf_Element_Stream($val), $objNum, $genNum, $factory);
     $this->dictionary = new Zend_Pdf_Element_Dictionary();
     $this->dictionary->Length = new Zend_Pdf_Element_Numeric($this->length());
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:15,代碼來源:Stream.php


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