ByteScout PDF Suite - VBScript - Set show and hide widget in pdf with pdf sdk - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF Suite – VBScript – Set show and hide widget in pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – VBScript – Set show and hide widget in pdf with pdf sdk

How to set show and hide widget in pdf with pdf sdk in VBScript with ByteScout PDF Suite

Learn to code in VBScript to set show and hide widget in pdf with pdf sdk with this step-by-step tutorial

This sample source code below will display you how to 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 PDF Suite is designed for it. ByteScout PDF Suite is the bundle that provides six different SDK libraries to work with PDF from generating rich PDF reports to extracting data from PDF documents and converting them to HTML. This bundle includes PDF (Generator) SDK, PDF Renderer SDK, PDF Extractor SDK, PDF to HTML SDK, PDF Viewer SDK and PDF Generator SDK for Javascript.

This prolific sample source code in VBScript for ByteScout PDF Suite contains various functions and other necessary options you should do calling the API to set show and hide widget in pdf with pdf sdk. Follow the instructions from scratch to work and copy the VBScript code. Further improvement of the code will make it more robust.

Trial version of ByteScout PDF Suite is available for free. Source code samples are included to help you with your VBScript app.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

ShowHideWidget.vbs
      
' 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

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next