Sample source code below will display you how to manage a complex task like set show and hide widget in pdf with pdf sdk in VBScript. Want to set show and hide widget in pdf with pdf sdk in your VBScript app? ByteScout Premium Suite is designed for it. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording.
These VBScript code samples for VBScript guide developers to speed up coding of the application when using ByteScout Premium Suite. IF you want to implement the functionality, just copy and paste this code for VBScript below into your code editor with your app, compile and run your application. Further improvement of the code will make it more robust.
You can download free trial version of ByteScout Premium Suite from our website with this and other source code samples for VBScript.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
' This example demonstrates how to show/hide a widget in document. ' Create Bytescout.PDF.Document object Set pdfDocument = CreateObject("Bytescout.PDF.Document") pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" Set comHelpers = pdfDocument.ComHelpers ' Add page Set page1 = comHelpers.CreatePage(comHelpers.PAPERFORMAT_A4) pdfDocument.Pages.Add(page1) ' Create widget that will be shown/hidden Set editBox1 = comHelpers.CreateEditBox(20, 20, 100, 25, "editBox1") editBox1.Text = "editBox1" page1.Annotations.Add(editBox1) ' Create button that will show the widget Set buttonShow = comHelpers.CreatePushButton(20, 80, 50, 25, "buttonShow") buttonShow.Caption = "Show" page1.Annotations.Add(buttonShow) ' Add Show action Set showAction = comHelpers.CreateHideAction(False) showAction.Fields.Add(editBox1) buttonShow.OnActivated = showAction ' Create button that will hide the widget Set buttonHide = comHelpers.CreatePushButton(100, 80, 50, 25, "buttonHide") buttonHide.Caption = "Hide" page1.Annotations.Add(buttonHide) ' Add Hide action Set hideAction = comHelpers.CreateHideAction(True) hideAction.Fields.Add(editBox1) buttonHide.OnActivated = hideAction ' Save document to file pdfDocument.Save("result.pdf") ' Open document in default PDF viewer app Set shell = CreateObject("WScript.Shell") shell.Run "result.pdf", 1, false
60 Day Free Trial or Visit ByteScout Premium Suite Home Page
Explore ByteScout Premium Suite Documentation
Explore Samples
Sign Up for ByteScout Premium Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout Premium Suite Home Page
Explore ByteScout Premium Suite Documentation
Explore Samples
Sign Up for ByteScout Premium Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: