将内部超链接添加到pdf [英] Adding internal hyperlink to a pdf

查看:124
本文介绍了将内部超链接添加到pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PDF文档,我想向其添加内部超链接. 具体来说,第1页包含一个我想使其可单击的目录. 我的想法是在第1页的预定位置创建矩形框,该矩形框应链接到第2、3,...

I have a PDF document to which I want to add internal hyperlinks. Specifically, page 1 contains a table of contents which I want to make clickable. My idea is to create rectangular boxes in predetermined locations on page 1, which should link to pages 2, 3, ...

我发现了这篇文章,其中谈到了使用上述方法添加内部超链接. http://bugs.ghostscript.com/show_bug.cgi?id=691531

I found this post which talks about adding internal hyperlinks using the method I described above. http://bugs.ghostscript.com/show_bug.cgi?id=691531

但是,当我尝试在文件中使用此技术时,脚本只是带有矩形和超链接的ADDS页面. 我需要它来将超链接覆盖在我的第一页的现有内容上.

However, when I try to use this technique in my file, the script just ADDS pages with the rectangle and hyperlink. I need it to overlay the hyperlink on the existing contents of my first page.

推荐答案

这是我使用的:

从MATLAB调用Ghostscript函数:

Ghostscript function call from MATLAB:

-o output.pdf -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress original.pdf script.ps

保存在script.ps中的后记代码:

Postscript code saved in script.ps:

[ /Rect [10 10 50 50]
/Page 2
/SrcPg 1
/Subtype /Link
/ANN pdfmark

这篇关于将内部超链接添加到pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆