iText矩形 - 无法删除边框

时间:2013-02-19 20:53:04

标签: itext

我似乎无法移除矩形上的边框!请参阅下面的代码,我正在使用PDF注释创建链接。链接全部工作,但每个矩形都有一个边框。

PdfAnnotation annotation;
Rectangle rect = new Rectangle(xOffset, yOffset, xOffset + tab.getScaledWidth(),      yOffset+tab.getScaledHeight());

rect.setBorder(Rectangle.NO_BORDER);

annotation = PdfAnnotation.createLink(writer, rect, PdfAnnotation.HIGHLIGHT_NONE,      PdfAction.gotoLocalPage(section.GetStartPageIndex() + 1,destination, writer));

stamper.addAnnotation(annotation,i);

2 个答案:

答案 0 :(得分:4)

我已经意识到这是带边框的注释,可以删除使用

annotation.setBorder(new PdfBorderArray(0f, 0f, 0f));

答案 1 :(得分:0)

或者您可以使用:

annotation.BorderStyle = new PdfBorderDictionary(0f, 0);
相关问题