本文整理匯總了PHP中Zend_Pdf::getNamedDestinations方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Pdf::getNamedDestinations方法的具體用法?PHP Zend_Pdf::getNamedDestinations怎麽用?PHP Zend_Pdf::getNamedDestinations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Pdf
的用法示例。
在下文中一共展示了Zend_Pdf::getNamedDestinations方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testProcessing
public function testProcessing()
{
$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);
// not actually included into pages array
$pdf->pages[] = $page1;
$pdf->pages[] = $page2;
$this->assertTrue(count($pdf->getNamedDestinations()) == 0);
// require_once 'Zend/Pdf/Destination/Fit.php';
$destination1 = Zend_Pdf_Destination_Fit::create($page1);
$destination2 = Zend_Pdf_Destination_Fit::create($page2);
$action1 = Zend_Pdf_Action_GoTo::create($destination1);
$pdf->setNamedDestination('GoToPage1', $action1);
$this->assertTrue($pdf->getNamedDestination('GoToPage1') === $action1);
$this->assertTrue($pdf->getNamedDestination('GoToPage9') === null);
$pdf->setNamedDestination('Page2', $destination2);
$this->assertTrue($pdf->getNamedDestination('Page2') === $destination2);
$this->assertTrue($pdf->getNamedDestination('Page9') === null);
$pdf->setNamedDestination('Page1', $destination1);
$pdf->setNamedDestination('Page1_1', Zend_Pdf_Destination_Fit::create(1));
$pdf->setNamedDestination('Page9_1', Zend_Pdf_Destination_Fit::create(9));
// will be egnored
$action3 = Zend_Pdf_Action_GoTo::create(Zend_Pdf_Destination_Fit::create($page3));
$pdf->setNamedDestination('GoToPage3', $action3);
$this->assertTrue(strpos($pdf->render(), '[(GoToPage1) <</Type /Action /S /GoTo /D [3 0 R /Fit ] >> (Page1) [3 0 R /Fit ] (Page1_1) [1 /Fit ] (Page2) [4 0 R /Fit ] ]') !== false);
}