I am trying to get a link to open in a new window or tab from my PDF using csharp/synfusion
I have the following code;
PdfUriAnnotation uriAnnotation = new PdfUriAnnotation(new RectangleF(intX + 4, intY, intWidth – 6, height), objSetting.LinkToGoTo);
page.Annotations.Add(uriAnnotation);
// Create JavaScript action to open the link in a new window.
string javaScript = “app.launchURL(‘” + objSetting.LinkToGoTo + “‘, true);”;
PdfJavaScriptAction jsAction = new PdfJavaScriptAction(javaScript);
//Create and add new launch Action to the document.
document.Actions.AfterOpen = jsAction;
//The text that is clicked to launch the link
page.Graphics.DrawString(objSetting.LinkText);
the link works, but does not go to a new window…please can anyone help?
thank you
caz444 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.