ByteScout PDF SDK - VB.NET - Add JavaScript Action in PDF - ByteScout

ByteScout PDF SDK – VB.NET – Add JavaScript Action in PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VB.NET – Add JavaScript Action in PDF

How to add javascript action in PDF in VB.NET with ByteScout PDF SDK

Write code in VB.NET to add javascript action in PDF with this step-by-step tutorial

The coding tutorials are designed to help you test the features without need to write your own code. ByteScout PDF SDK: the pdf library that can create, update and modify PDF files. Supports text with fonts and style selections, layers, form fields, drawing lines and objects, automatic tables, images. Can be used to create and fill pdf forms. It can add javascript action in PDF in VB.NET.

This code snippet below for ByteScout PDF SDK works best when you need to quickly add javascript action in PDF in your VB.NET application. Follow the instructions from the scratch to work and copy the VB.NET code. Test VB.NET sample code examples whether they respond your needs and requirements for the project.

Free trial version of ByteScout PDF SDK is available for download from our website. Get it to try other source code samples for VB.NET.

Try ByteScout PDF SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

Program.vb
      
Imports Bytescout.PDF ''' <summary> ''' This example demonstrates how to add JavaScript actions to document events. ''' </summary> Class Program Shared Sub Main() ' Create new document Dim pdfDocument = New Document() pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" ' Add page pdfDocument.Pages.Add(New Page(PaperFormat.A4)) ' Add action to document open event Dim onOpenDocument = New JavaScriptAction("app.alert(""OnOpenDocument"",3)") pdfDocument.OnOpenDocument = onOpenDocument ' Add action to document close event Dim onBeforeClosing = New JavaScriptAction("app.alert(""OnBeforeClosing"",3)") pdfDocument.OnBeforeClosing = onBeforeClosing ' Save document to file pdfDocument.Save("result.pdf") ' Cleanup pdfDocument.Dispose() ' Open document in default PDF viewer app Process.Start("result.pdf") End Sub End Class

Try ByteScout PDF SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

VIDEO

ON-PREMISE VERSION INFORMATION

Get 60 Day Free Trial or Visit ByteScout PDF SDK Home Page

Explore ByteScout PDF SDK Documentation

Get ByteScout PDF SDK Free Training

WEB API

Get Your Free API Key

Explore Web API Documentation

Tutorials:

prev
next