IText rectangle - cannot remove border

I cannot remove the border to the rectangle! See the code below, I am creating a link using PDFannotation. All links work, but each rectangle has a border.

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

      

+3


source to share


2 answers


I figured it out is an annotation that has a border to remove the use of



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

      

+4


source


Or you can use:



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

      

0


source







All Articles