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


PHP Bookmark::Create方法代码示例

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


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

示例1: PDFDoc

// go-to action, but jumps to a destination in another PDF file instead
// of the current file. See Section 8.5.3 'Remote Go-To Actions' in PDF
// Reference Manual for details.
// Open the document that was saved in the previous code sample
$doc = new PDFDoc($output_path . "bookmark.pdf");
$doc->InitSecurityHandler();
// Create file specification (the file referred to by the remote bookmark)
$file_spec = $doc->CreateIndirectDict();
$file_spec->PutName("Type", "Filespec");
$file_spec->PutString("F", "bookmark.pdf");
$spec = new FileSpec($file_spec);
$goto_remote = Action::CreateGotoRemote($spec, 5, true);
$remoteBookmark1 = Bookmark::Create($doc, "REMOTE BOOKMARK 1");
$remoteBookmark1->SetAction($goto_remote);
$doc->AddRootBookmark($remoteBookmark1);
// Create another remote bookmark, but this time using the low-level SDF/Cos API.
// Create a remote action
$remoteBookmark2 = Bookmark::Create($doc, "REMOTE BOOKMARK 2");
$doc->AddRootBookmark($remoteBookmark2);
$gotoR = $remoteBookmark2->GetSDFObj()->PutDict("A");
$gotoR->PutName("S", "GoToR");
// Set action type
$gotoR->PutBool("NewWindow", true);
// Set the file specification
$gotoR->Put("F", $file_spec);
// jump to the first page. Note that pages are indexed from 0.
$dest = $gotoR->PutArray("D");
// Set the destination
$dest->PushBackNumber(9);
$dest->PushBackName("Fit");
$doc->Save($output_path . "bookmark_remote.pdf", SDFDoc::e_linearized);
开发者ID:anrao91,项目名称:PDFNetWrappers,代码行数:31,代码来源:BookmarkTest.php


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