2013-02-19 51 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);