iText矩形-can';不要删除边框

iText矩形-can';不要删除边框,itext,Itext,我似乎无法删除矩形上的边框!请参阅下面的代码,我正在使用PDFanRotation创建链接。所有链接都有效,但每个矩形都有边框 PdfAnnotation annotation; Rectangle rect = new Rectangle(xOffset, yOffset, xOffset + tab.getScaledWidth(), yOffset+tab.getScaledHeight()); rect.setBorder(Rectangle.NO_BORDER); ann

我似乎无法删除矩形上的边框!请参阅下面的代码,我正在使用PDFanRotation创建链接。所有链接都有效,但每个矩形都有边框

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);

我已经意识到这是一个注释,它有边框,可以删除使用

annotation.setBorder(new PdfBorderArray(0f, 0f, 0f));
或者您可以使用:

annotation.BorderStyle = new PdfBorderDictionary(0f, 0);

我对你的问题投了赞成票,我建议你批准自己的答案。这样,其他人就可以看到问题已经解决了。