Samples: Add Javascript Actions to PDF Files

   Minimize
  Add Javascript Actions to PDF Files Sample for C# / VB.NET


Download the sample here
 

[C#]

PdfDocumentBuilder pdfbuilder = new PdfDocumentBuilder();

PdfDocumentEditor editor = new PdfDocumentEditor(filename);

editor.AddOpenAction(pdfbuilder.ActionFactory.CreateJavaScriptAction("app.alert(\"You are looking at Java script action demo of Nasosoft PDF \\r\\n\\t www.nasosoft.com \")"));

editor.Save(outfile);

[VB.NET]

Dim builder As New PdfDocumentBuilder

Dim editor As New PdfDocumentEditor(filename)

editor.AddOpenAction(builder.ActionFactory.CreateJavaScriptAction("app.alert(""You are looking at Java script action demo of Nasosoft PDF \\r\\n\\t www.nasosoft.com "")"))

editor.Save(outfile)