title: How to add hyperlink in pdf using pdfbox
body: <p>I want to add a hyperlink in PDF created using <code>PDFBOX</code>, such that i click on some text example 'Click here' will redirect to URL. I tried using <code>PDAnnotationLink</code> and <code>PDActionURI</code>, but how to add it in <code>contentstream</code>?</p>
  
  <pre><code>PDBorderStyleDictionary borderULine = new PDBorderStyleDictionary();
  borderULine.setStyle(PDBorderStyleDictionary.STYLE_UNDERLINE);
  PDAnnotationLink txtLink = new PDAnnotationLink();
  txtLink.setBorderStyle(borderULine);
  txtLink.setColour(colourBlue);
  
  // add an action
  PDActionURI action = new PDActionURI();
  action.setURI("www.google.com");
  txtLink.setAction(action);
  
  contentStream.beginText();
  contentStream.moveTextPositionByAmount(400, y-30);
  contentStream.drawString(txtLink);----error
  contentStream.endText();
  </code></pre>