title: TCPDF - How to hyperlink text to external document using TCPDF
body: <p>Does anyone know how to hyperlink text within the pdf to an external attached document. I am already using the annotation() and bookmark() functions to include the links in the sidebar, but can't seem to figure out how to provide that link within the pdf document itself. Any help would be greatly appreciated.
  My bad, I am new to stack and screen I was in wouldn't let me use any line breaks - I was just in the wrong place. Sorry about that.</p>
  
  <p>The code where the link needs to go is:</p>
  
  <p>$txt.='&nbsp;'.stripslashes($contents).'';</p>
  
  <ul>
  <li>I then use writeHTML() to process the file</li>
  <li>Text within the contents string needs to be replaced with the text link to the attached document.</li>
  </ul>
  
  <p>The sidebar code I use is:</p>
  
  <p>$pdf->Annotation(-10, -10, 0, 0, $fndesc, array('Subtype'=>'FileAttachment', 'Name' => 'Pushpin', 'FS' => $attachment));</p>
  
  <p>$pdf->Bookmark($fndesc, 0, 0, '', 'B', array(0,64,128), -1, $fn);</p>
  
  <p>The real issue is to replace the pushpin inside of the primary document (not the sidebar) with the linked text.</p>
  
  <p>Thank you very much for even responding.</p>