Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] Hyperlink without a visible border

slforms@gmx.de

2006-06-19

Replies:

Hi,

I'm trying to set a hyperlink on an existing PDF-file.
Therefor I create an instance of the PDFStamper class and create a
rectangle within a PdfAnnotation.
Everything works fine with that, but the Problem is, that when I open
the pdf-file, the rectangle (containing the hyperlink) is surrounded by
a border. I tried to set the border-width to 0 or set the border-color =
white. Nothing of that works. The border is still visible in Adobe Reader.
But if I print out the PDF, the border is invisible. So my question is,
how can I remove the border of that hyperlink, so that it is not visible
in the Adobe Reader? Can someone help me?

***** CODE *****
PdfStamper stamp = new PdfStamper(reader, fos);
Rectangle rec = new Rectangle(22, 38, 42, 310);
rec.setBorderWidth(0);
Color col = new Color(0,0,0);
rec.setBorderColor(col);
PdfAction action = new PdfAction("_http://www.google.de_");
PdfAnnotation link = PdfAnnotation.createLink(stamp.getWriter(), rec,
PdfName.HIDE, action);
stamp.addAnnotation(link, 1);
stamp.close();

*******************
Thanks for your answers,

Sebastian Lindauer


_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.