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


PHP Zend_Pdf::resolveDestination方法代码示例

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


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

示例1:

<?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

示例2: testGetDestination2

 public function testGetDestination2()
 {
     $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;
     require_once 'Zend/Pdf/Destination/Fit.php';
     $action1 = Zend_Pdf_Action_GoTo::create(Zend_Pdf_Destination_Fit::create($page2));
     $action2 = Zend_Pdf_Action_GoTo::create(Zend_Pdf_Destination_Fit::create($page3));
     $this->assertTrue($pdf->resolveDestination($action1->getDestination()) === $page2);
     $this->assertTrue($pdf->resolveDestination($action2->getDestination()) === null);
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:15,代码来源:ActionTest.php


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