2013-02-19 94 views
3

我似乎无法删除矩形上的边框!请参阅下面的代码,我使用PDFannotation创建链接。链接全部正常,但每个矩形都有边框。iText矩形 - 无法删除边框

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

回答

4

我已经意识到这其中有边框的注释,除去使用

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

我upvoted你的问题,我建议你批准你自己的答案。这样,其他人就可以看到问题解决了。 – 2013-02-20 14:03:03

0

或者你可以使用:

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