简体   繁体   English

使用Zend_pdf在target =“ _ blank”的PDF中添加链接

[英]Add link in PDF with target=“_blank” using Zend_pdf

My code: 我的代码:

$page->drawText('Text', 80, 576, 'utf-8'); $ page-> drawText('Text',80,576,'utf-8');

$target = Zend_Pdf_Action_URI :: create( ' http://www.stackoverflow.com '); $ target = Zend_Pdf_Action_URI :: create(' http://www.stackoverflow.com ');

$annotation = Zend_Pdf_Annotation_Link :: create( 0, 0, 0, 0, $target); $ annotation = Zend_Pdf_Annotation_Link :: create(0,0,0,0,$ target);

$page->attachAnnotation( $annotation ); $ page-> attachAnnotation($ annotation);

i'm creating a PDF file with a link and I need to open the link in a new window. 我正在创建带有链接的PDF文件,我需要在新窗口中打开链接。 How can i do that? 我怎样才能做到这一点?

An URI action does not allow you to define that the target should be opened in a new window. URI操作不允许您定义应在新窗口中打开目标。 This is a PDF sepcific behavior. 这是PDF的特殊行为。 Other actions like "Launch" have a "NewWindow" flag but this will only get attention if the document is opened in the Reader application and not through a browser plugin. 其他操作(例如“启动”)都有一个“ NewWindow”标志,但是只有在Reader应用程序中打开文档而不是通过浏览器插件打开文档时,此标志才会引起注意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM