How can I execute a JavaScript code (Acrobat JavaScript) when the PDF document is opened in the viewer?
You can use the Document.OpenAction.Action property to set a PdfActionJavaScript object representing the JavaScript code you want to execute when the PDF document is opened in the viewer. For example you can use the code below to display an alert message when the document is opened: document.OpenAction.Action = new PdfActionJavaScript(“app.alert(‘Hello’);”); The document object is either the Document instance created by your application when using the PDF Creator product or a Document object produced by the HTML to PDF library when using a method like PdfConverter.GetPdfDocumentObjectFromUrl().