Q: I'm looking for a .NET component that can be called from C# that
can add hyperlink to the pdf file. Here is the sample for what I need:
For example my PDF file contains the following text "Our plugin is an
easy-to-use application designed for users familiar with Microsoft(r)
Office and similar applications."
I need to have my program search the text to find the 'Microsoft '
word, if found, then place the 'www.microsoft.com' link for that word
and save the PDF file. Then in the saved
PDF file, I can click the word 'Microsoft' and open the browser to
visit the website. The process has to be done programmatically.
A: You can use PDFNet SDK (http://www.pdftron.com/net) to implement
In order to find a given word within a PDF document, you can use
pdftron.PDF.TextExtractior. TextExtractior (http://www.pdftron.com/net/
html/classpdftron_1_1PDF_1_1TextExtractor.html) will allow you to
iterate through text on each PDF page line-by-line and word-by-word.
Among other information you can access text positioning information
using word.GetBBox(). This information can be used to create a
hyperlink annotation (as shown in Annotation sample project -
http://www.pdftron.com/net/samplecode.html#Annotation). For example:
Annot hyperlink = Annot.CreateLink(doc, word_bbox,