txtMark.setContents("Highlighted since it's important");
annotations.add(txtMark);
// Now add the link annotation, so the clickme works
PDAnnotationLink txtLink = new PDAnnotationLink();
txtLink.setBorderStyle(borderULine);
// Set the rectangle containing the link
textWidth = (font.getStringWidth( "Click Here" )/1000) * 18;
position = new PDRectangle();
position.setLowerLeftX(inch);
position.setLowerLeftY( ph-(float)(1.5*inch)-20); // down a couple of points
position.setUpperRightX(72 + textWidth);
position.setUpperRightY(ph-(float)(1.5*inch));
txtLink.setRectangle(position);
// add an action
PDActionURI action = new PDActionURI();
action.setURI("http://www.pdfbox.org");
txtLink.setAction(action);
annotations.add(txtLink);
// Now draw a few more annotations