• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Pdf_Action类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __construct

 /**
  * Object constructor
  *
  * @param Zend_Pdf_Element_Dictionary $dictionary
  * @param SplObjectStorage            $processedActions  list of already processed action dictionaries, used to avoid cyclic references
  * @throws Zend_Pdf_Exception
  */
 public function __construct(Zend_Pdf_Element $dictionary, SplObjectStorage $processedActions)
 {
     require_once 'Zend/Pdf/Element.php';
     if ($dictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('$dictionary mast be a direct or an indirect dictionary object.');
     }
     $this->_actionDictionary = $dictionary;
     if ($dictionary->Next !== null) {
         if ($dictionary->Next instanceof Zend_Pdf_Element_Dictionary) {
             // Check if dictionary object is not already processed
             if (!$processedActions->contains($dictionary->Next)) {
                 $processedActions->attach($dictionary->Next);
                 $this->next[] = Zend_Pdf_Action::load($dictionary->Next, $processedActions);
             }
         } else {
             if ($dictionary->Next instanceof Zend_Pdf_Element_Array) {
                 foreach ($dictionary->Next->items as $chainedActionDictionary) {
                     // Check if dictionary object is not already processed
                     if (!$processedActions->contains($chainedActionDictionary)) {
                         $processedActions->attach($chainedActionDictionary);
                         $this->next[] = Zend_Pdf_Action::load($chainedActionDictionary, $processedActions);
                     }
                 }
             } else {
                 require_once 'Zend/Pdf/Exception.php';
                 throw new Zend_Pdf_Exception('PDF Action dictionary Next entry must be a dictionary or an array.');
             }
         }
     }
     $this->_originalNextList = $this->next;
 }
开发者ID:kokx,项目名称:zf-library,代码行数:39,代码来源:Action.php


示例2: load

 /**
  * Parse resource and return it as an Action or Explicit Destination
  *
  * $param Zend_Pdf_Element $resource
  * @return Zend_Pdf_Destination|
  * @throws Zend_Pdf_Exception
  */
 public static function load(Zend_Pdf_Element $resource)
 {
     require_once 'Zend/Pdf/Element.php';
     if ($resource->getType() == Zend_Pdf_Element::TYPE_DICTIONARY) {
         if (($resource->Type === null || $resource->Type->value == 'Action') && $resource->S !== null) {
             // It's a well-formed action, load it
             require_once 'Zend/Pdf/Action.php';
             return Zend_Pdf_Action::load($resource);
         } else {
             if ($resource->D !== null) {
                 // It's a destination
                 $resource = $resource->D;
             } else {
                 require_once 'Zend/Pdf/Exception.php';
                 throw new Zend_Pdf_Exception('Wrong resource type.');
             }
         }
     }
     if ($resource->getType() == Zend_Pdf_Element::TYPE_ARRAY || $resource->getType() == Zend_Pdf_Element::TYPE_NAME || $resource->getType() == Zend_Pdf_Element::TYPE_STRING) {
         // Resource is an array, just treat it as an explicit destination array
         require_once 'Zend/Pdf/Destination.php';
         return Zend_Pdf_Destination::load($resource);
     } else {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Wrong resource type.');
     }
 }
开发者ID:conectapb,项目名称:sysagroweb,代码行数:34,代码来源:Target.php


示例3: load

 /**
  * Parse resource and return it as an Action or Explicit Destination
  *
  * $param Zend_Pdf_Element $resource
  * @return Zend_Pdf_Destination|
  * @throws Zend_Pdf_Exception
  */
 public static function load(Zend_Pdf_Element $resource)
 {
     if ($resource->getType() == Zend_Pdf_Element::TYPE_DICTIONARY) {
         // Load destination as appropriate action
         return Zend_Pdf_Action::load($resource);
     } else {
         if ($resource->getType() == Zend_Pdf_Element::TYPE_ARRAY || $resource->getType() == Zend_Pdf_Element::TYPE_NAME || $resource->getType() == Zend_Pdf_Element::TYPE_STRING) {
             // Resource is an array, just treat it as an explicit destination array
             return Zend_Pdf_Destination::load($resource);
         } else {
             require_once 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('Wrong resource type.');
         }
     }
 }
开发者ID:jingjangjung,项目名称:Storefront,代码行数:22,代码来源:Target.php


示例4: getTarget

 /**
  * Get outline target.
  *
  * @return Zend_Pdf_Target
  * @throws Zend_Pdf_Exception
  */
 public function getTarget()
 {
     if ($this->_outlineDictionary->Dest !== null) {
         if ($this->_outlineDictionary->A !== null) {
             require_once 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('Outline dictionary may contain Dest or A entry, but not both.');
         }
         require_once 'Zend/Pdf/Destination.php';
         return Zend_Pdf_Destination::load($this->_outlineDictionary->Dest);
     } else {
         if ($this->_outlineDictionary->A !== null) {
             require_once 'Zend/Pdf/Action.php';
             return Zend_Pdf_Action::load($this->_outlineDictionary->A);
         }
     }
     return null;
 }
开发者ID:Yaoming9,项目名称:Projet-Web-PhP,代码行数:23,代码来源:Loaded.php


示例5: _cleanUpAction

    /**
     * Walk through action and its chained actions tree and remove nodes
     * if they are GoTo actions with an unresolved target.
     *
     * Returns null if root node is deleted or updated action overwise.
     *
     * @todo Give appropriate name and make method public
     *
     * @param Zend_Pdf_Action $action
     * @param boolean $refreshPagesHash  Refresh page collection hashes before processing
     * @return Zend_Pdf_Action|null
     */
    protected function _cleanUpAction(Zend_Pdf_Action $action, $refreshPageCollectionHashes = true)
    {
        if ($this->_pageReferences === null  ||  $refreshPageCollectionHashes) {
            $this->_refreshPagesHash();
        }

        // Named target is an action
        if ($action instanceof Zend_Pdf_Action_GoTo  &&
            $this->resolveDestination($action->getDestination(), false) === null) {
            // Action itself is a GoTo action with an unresolved destination
            return null;
        }

        // Walk through child actions
        $iterator = new RecursiveIteratorIterator($action, RecursiveIteratorIterator::SELF_FIRST);

        $actionsToClean        = array();
        $deletionCandidateKeys = array();
        foreach ($iterator as $chainedAction) {
            if ($chainedAction instanceof Zend_Pdf_Action_GoTo  &&
                $this->resolveDestination($chainedAction->getDestination(), false) === null) {
                // Some child action is a GoTo action with an unresolved destination
                // Mark it as a candidate for deletion
                $actionsToClean[]        = $iterator->getSubIterator();
                $deletionCandidateKeys[] = $iterator->getSubIterator()->key();
            }
        }
        foreach ($actionsToClean as $id => $action) {
            unset($action->next[$deletionCandidateKeys[$id]]);
        }

        return $action;
    }
开发者ID:nhp,项目名称:shopware-4,代码行数:45,代码来源:Pdf.php


示例6: getDestination

 /**
  * Get link annotation destination
  *
  * @return Zend_Pdf_Target|null
  */
 public function getDestination()
 {
     if ($this->_annotationDictionary->Dest === null && $this->_annotationDictionary->A === null) {
         return null;
     }
     if ($this->_annotationDictionary->Dest !== null) {
         #require_once 'Zend/Pdf/Destination.php';
         return Zend_Pdf_Destination::load($this->_annotationDictionary->Dest);
     } else {
         #require_once 'Zend/Pdf/Action.php';
         return Zend_Pdf_Action::load($this->_annotationDictionary->A);
     }
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:18,代码来源:Link.php


示例7: testActionURILoad2

 public function testActionURILoad2()
 {
     $dictionary = new Zend_Pdf_Element_Dictionary();
     $dictionary->Type = new Zend_Pdf_Element_Name('Action');
     $dictionary->S = new Zend_Pdf_Element_Name('URI');
     try {
         $action = Zend_Pdf_Action::load($dictionary);
         $this->fail("exception expected");
     } catch (Zend_Pdf_Exception $e) {
         $this->assertContains('URI action dictionary entry is required', $e->getMessage());
     }
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:12,代码来源:ActionTest.php


示例8: getDestination

 /**
  * Get link annotation destination
  *
  * @return Zend_Pdf_Target|null
  */
 public function getDestination()
 {
     if ($this->_annotationDictionary->Dest === null && $this->_annotationDictionary->A === null) {
         return null;
     }
     if ($this->_annotationDictionary->Dest !== null) {
         return Zend_Pdf_Destination::load($this->_annotationDictionary->Dest);
     } else {
         return Zend_Pdf_Action::load($this->_annotationDictionary->A);
     }
 }
开发者ID:robeendey,项目名称:ce,代码行数:16,代码来源:Link.php


示例9: __construct

 /**
  * Object constructor
  *
  * @param Zend_Pdf_Element_Dictionary $dictionary
  * @param SplObjectStorage            $processedActions  list of already processed action dictionaries, used to avoid cyclic references
  * @throws Zend_Pdf_Exception
  */
 public function __construct(Zend_Pdf_Element $dictionary, SplObjectStorage $processedActions)
 {
     parent::__construct($dictionary, $processedActions);
     if ($dictionary->URI === null) {
         //require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('URI action dictionary entry is required');
     }
 }
开发者ID:chaimvaid,项目名称:linet3,代码行数:15,代码来源:URI.php


示例10: __construct

 /**
  * Object constructor
  *
  * @param Zend_Pdf_Element_Dictionary $dictionary
  * @param SplObjectStorage            $processedActions  list of already processed action dictionaries, used to avoid cyclic references
  */
 public function __construct(Zend_Pdf_Element $dictionary, SplObjectStorage $processedActions)
 {
     parent::__construct($dictionary, $processedActions);
     $this->_destination = Zend_Pdf_Destination::load($dictionary->D);
 }
开发者ID:Yaoming9,项目名称:Projet-Web-PhP,代码行数:11,代码来源:GoTo.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Pdf_Annotation类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Pdf类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap