I got a large PDF which is embedded in a homepage and should have interactive links with custom javascript commands in it.
This document should be maintained by some students and it is not possible for them to go through all sites and set the javascript commands after a change in the original word file. So i want them to set hyperlinks in word where an action should occur.
After that i want to remove the hyperlink with iTextSharp and set a javascript action instead.
I can communicate with HTML, find the hyperlinks correctly and can change their url like in this post
Also tried to add this to the annotation action:
string destination = AnnotationAction.GetAsString(PdfName.URI).ToString();
AnnotationAction.Put(PdfName.JAVASCRIPT, new PdfString("this.hostContainer.postMessage(\"" + destination + "\");"));
But it is always calling the original hyperlink before it is executing the javascript. So how can i remove the hyperlink without losing the formation of the text within the document?