2
我的程序将PDF文件中的一个位置链接到同一文件中的另一个页面。所以你可以点击文件中定义的位置,你将链接到另一个页面。我使用PDRectangle
来定义位置。不幸的是矩形在文档中是可见的。我想创建没有可见边框的链接。Java用PDFBox创建PDF页面的链接
我的代码:
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标志”。我不知道那里发生了什么。
如何更改我的矩形的可见性或完全删除边框?