当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Pdf_Element_Reference::getType方法代码示例

本文整理汇总了PHP中Zend_Pdf_Element_Reference::getType方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Pdf_Element_Reference::getType方法的具体用法?PHP Zend_Pdf_Element_Reference::getType怎么用?PHP Zend_Pdf_Element_Reference::getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Pdf_Element_Reference的用法示例。


在下文中一共展示了Zend_Pdf_Element_Reference::getType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _loadPages

 /**
  * Load pages recursively
  *
  * @param Zend_Pdf_Element_Reference $pages
  * @param array|null $attributes
  */
 protected function _loadPages(Zend_Pdf_Element_Reference $pages, $attributes = array())
 {
     if ($pages->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
         throw new Zend_Pdf_Exception('Wrong argument');
     }
     foreach ($pages->getKeys() as $property) {
         if (in_array($property, self::$_inheritableAttributes)) {
             $attributes[$property] = $pages->{$property};
             $pages->{$property} = null;
         }
     }
     foreach ($pages->Kids->items as $child) {
         if ($child->Type->value == 'Pages') {
             $this->_loadPages($child, $attributes);
         } else {
             if ($child->Type->value == 'Page') {
                 foreach (self::$_inheritableAttributes as $property) {
                     if ($child->{$property} === null && array_key_exists($property, $attributes)) {
                         /**
                          * Important note.
                          * If any attribute or dependant object is an indirect object, then it's still
                          * shared between pages.
                          */
                         if ($attributes[$property] instanceof Zend_Pdf_Element_Object || $attributes[$property] instanceof Zend_Pdf_Element_Reference) {
                             $child->{$property} = $attributes[$property];
                         } else {
                             $child->{$property} = $this->_objFactory->newObject($attributes[$property]);
                         }
                     }
                 }
                 $this->pages[] = new Core_Pdf_Page($child, $this->_objFactory);
             }
         }
     }
 }
开发者ID:uglide,项目名称:zfcore-transition,代码行数:41,代码来源:Pdf.php

示例2: _loadPages

 /**
  * Load pages recursively
  *
  * @param Zend_Pdf_Element_Reference $pages
  */
 private function _loadPages(Zend_Pdf_Element_Reference $pages)
 {
     if ($pages->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
         throw new Zend_Pdf_Exception('Wrong argument');
     }
     foreach ($pages->Kids->items as $child) {
         if ($child->Type->value == 'Pages') {
             $this->_loadPages($child);
         } else {
             if ($child->Type->value == 'Page') {
                 $this->pages[] = new Zend_Pdf_Page($child, $this->_objFactory);
             }
         }
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:20,代码来源:Pdf.php


注:本文中的Zend_Pdf_Element_Reference::getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。