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


PHP Zend_Pdf_Destination_Named类代码示例

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


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

示例1: create

 /**
  * Create new Zend_Pdf_Action_GoTo object using specified destination
  *
  * @param Zend_Pdf_Destination|string $destination
  * @return Zend_Pdf_Action_GoTo
  */
 public static function create($destination)
 {
     if (is_string($destination)) {
         require_once 'Zend/Pdf/Destination/Named.php';
         $destination = Zend_Pdf_Destination_Named::create($destination);
     }
     if (!$destination instanceof Zend_Pdf_Destination) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('$destination parameter must be a Zend_Pdf_Destination object or string.');
     }
     $dictionary = new Zend_Pdf_Element_Dictionary();
     $dictionary->Type = new Zend_Pdf_Element_Name('Action');
     $dictionary->S = new Zend_Pdf_Element_Name('GoTo');
     $dictionary->Next = null;
     $dictionary->D = $destination->getResource();
     return new Zend_Pdf_Action_GoTo($dictionary, new SplObjectStorage());
 }
开发者ID:Yaoming9,项目名称:Projet-Web-PhP,代码行数:23,代码来源:GoTo.php

示例2: setDestination

 /**
  * Set link annotation destination
  *
  * @param Zend_Pdf_Target|string $target
  * @return Zend_Pdf_Annotation_Link
  */
 public function setDestination($target)
 {
     if (is_string($target)) {
         #require_once 'Zend/Pdf/Destination/Named.php';
         $destination = Zend_Pdf_Destination_Named::create($target);
     }
     if (!$target instanceof Zend_Pdf_Target) {
         #require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('$target parameter must be a Zend_Pdf_Target object or a string.');
     }
     $this->_annotationDictionary->touch();
     $this->_annotationDictionary->Dest = $destination->getResource();
     if ($target instanceof Zend_Pdf_Destination) {
         $this->_annotationDictionary->Dest = $target->getResource();
         $this->_annotationDictionary->A = null;
     } else {
         $this->_annotationDictionary->Dest = null;
         $this->_annotationDictionary->A = $target->getResource();
     }
     return $this;
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:27,代码来源:Link.php

示例3: setTarget

 /**
  * Set outline target.
  * Null means no target
  *
  * @param Zend_Pdf_Target|string $target
  * @return Zend_Pdf_Outline
  * @throws Zend_Pdf_Exception
  */
 public function setTarget($target = null)
 {
     $this->_outlineDictionary->touch();
     if (is_string($target)) {
         require_once 'Zend/Pdf/Destination/Named.php';
         $target = Zend_Pdf_Destination_Named::create($target);
     }
     if ($target === null) {
         $this->_outlineDictionary->Dest = null;
         $this->_outlineDictionary->A = null;
     } else {
         if ($target instanceof Zend_Pdf_Destination) {
             $this->_outlineDictionary->Dest = $target->getResource();
             $this->_outlineDictionary->A = null;
         } else {
             if ($target instanceof Zend_Pdf_Action) {
                 $this->_outlineDictionary->Dest = null;
                 $this->_outlineDictionary->A = $target->getResource();
             } else {
                 require_once 'Zend/Pdf/Exception.php';
                 throw new Zend_Pdf_Exception('Outline target has to be Zend_Pdf_Destination or Zend_Pdf_Action object or string');
             }
         }
     }
     return $this;
 }
开发者ID:Yaoming9,项目名称:Projet-Web-PhP,代码行数:34,代码来源:Loaded.php

示例4: Zend_Pdf

<?php

/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$pdf = new Zend_Pdf();
$page1 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
$page2 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
$page3 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
// Page created, but not included into pages list
$pdf->pages[] = $page1;
$pdf->pages[] = $page2;
$destination1 = Zend_Pdf_Destination_Fit::create($page2);
$destination2 = Zend_Pdf_Destination_Fit::create($page3);
// Returns $page2 object
$page = $pdf->resolveDestination($destination1);
// Returns null, page 3 is not included into document yet
$page = $pdf->resolveDestination($destination2);
$pdf->setNamedDestination('Page2', $destination1);
$pdf->setNamedDestination('Page3', $destination2);
// Returns $destination2
$destination = $pdf->getNamedDestination('Page3');
// Returns $destination1
$pdf->resolveDestination(Zend_Pdf_Destination_Named::create('Page2'));
// Returns null, page 3 is not included into document yet
$pdf->resolveDestination(Zend_Pdf_Destination_Named::create('Page3'));
开发者ID:urki,项目名称:urki-test-project,代码行数:27,代码来源:new.php


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