【发布时间】:2017-09-11 09:16:47
【问题描述】:
我的程序将 PDF 文件中的位置链接到同一文件中的另一个页面。因此,您可以单击文件中定义的位置,然后您将链接到另一个页面。
我使用PDRectangle 来定义位置。不幸的是,矩形在文档中可见。我想创建没有可见边框的链接。
我的代码:
PDActionGoTo action = new PDActionGoTo();
action.setDestination(destination);
PDAnnotationLink annotationLink = new PDAnnotationLink();
annotationLink.setAction(action);
PDRectangle position = new PDRectangle();
position.setLowerLeftX(bookmarkLinkPositionEntry.getLowerLeftX());
position.setLowerLeftY(bookmarkLinkPositionEntry.getLowerLeftY());
position.setUpperRightX(bookmarkLinkPositionEntry.getUpperRightX());
position.setUpperRightY(bookmarkLinkPositionEntry.getUpperRightY());
annotationLink.setRectangle(position);
destinationPDF.getPage(0).getAnnotations().add(annotationLink);
我尝试使用annotationLink.setHidden(true); 和annotationLink.setNoView(true);。文档只是说“设置隐藏标志”。和“设置 noView 标志”。我不知道那里到底发生了什么。
如何更改矩形的可见性或完全移除边框?
【问题讨论】: