The PdfContentEditor class present underAspose.Pdf.Facades package provides the flexibility to add Javascript actions to a PDF file. You can create a link with the serial actions corresponding to execute a menu item in the PDF viewer. This class also provides the feature to create additional actions for document events.
First of all, an object is drawn in the Document, in our example a Rectangle. And set the action createJavaScriptLink to the Rectangle. After you may save your document.