在pdf文件上更改命名目的地的缩放级别 [英] Changing the zoom level for Named Destinations on a pdf file

查看:50
本文介绍了在pdf文件上更改命名目的地的缩放级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以更改命名目的地的缩放级别? 如果它是DEST条目,则可以简单地使用:

Is there any way to change the zoom level for Named Destinations? If it were a DEST entry one can simply use:

[...]
PdfArray d = annotation.getAsArray(PdfName.DEST);
if (d != null && d.size() == 5 && PdfName.XYZ.equals(d.getAsName(1)))
  d.set(4, new PdfNumber(0));

,但是对于命名目的地,显然没有任何方法可以更改 飞涨. 例如,在下面的链接中,您看到在第10页上没有 任何"DEST"条目,但一个"A"条目,命名的目的地是"se",但 无法更改缩放比例:

but for Named Destinations apparently there isn't any way to change the zoom. For example in the following link you see that on page 10 there isn't any "DEST" entry but an "A" one and the named destination is "se" but there isn't any way to change the zoom:

http://farm4.staticflickr.com/3846/14564676380_2f47b4b238_b.jpg

在此先感谢

C撒

推荐答案

真是个奇怪的问题.使用命名目标的优点是,目标与注释分开存储,但是您希望在注释中找到目标...

What a truly strange question. The advantage of using a named destination is that the destination is stored separately from the annotation, yet you expect to find the destination in the annotation...

请查看以下屏幕截图:

Please take a look at the following screen shot:

PDF的目录(或根字典)具有一个名为/Names的条目.该条目可以包含命名的JavaScript,命名的目的地等.在这种情况下,您需要Dests条目.它的值是一个名称树.在屏幕快照中,您看到与第20页上的目标/XYZ 36 802 0相对应的字符串对象AR.

The Catalog (or root dictionary) of a PDF has an entry called /Names. This entry can contain named JavaScript, named destinations, etc. In this case, you want the Dests entry. It's value is a name tree. In the screen shot, you see a string object AR that corresponds with the destination /XYZ 36 802 0 on page 20.

您应该在此名称树中查找目标位置,而不是查找 注释,因为注释仅包含 name ,而不是目标位置本身(如您所知)发现).

This name tree is where you should look for the destinations, not the annotation because the annotation only contains the name, not the destination itself (as you've already discovered).

这篇关于在pdf文件上更改命名目的地的缩放级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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