Q: How do I update hyperlinks within a PDF page?
-------
A: You can update hyperlinks (and other annotations) in existing PDF
documents along the lines of AnnotationHighLevelAPI in Annotation
sample project: http://www.pdftron.com/net/samplecode.html#Annotation
For example,
... init PDFNet, open doc...
Page page = doc.GetPage(1);
int num_annots = page.GetNumAnnots();
for (int i=0; i<num_annots; ++i) {
Annot annot = page.GetAnnot(i);
if (annot.IsValid() == false) continue;
if (annot.GetType() == Annot.Type.e_Link) {
Action action = annot.GetLinkAction();
if (action.Isalid() && action.GetType() == Action.Type.e_URI) {
// String old_uri =
action.GetSDFObj().Get("URI").Value().GetAsPDFText();
action.SetLinkAction(Action.CreateURI(doc, "http://
www.pdftron.com"));
}
}
}
... save pdf...