ByteScout Premium Suite - C# - Add show hide action to pdf with pdf sdk - ByteScout

ByteScout Premium Suite – C# – Add show hide action to pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – C# – Add show hide action to pdf with pdf sdk

How to add show hide action to pdf with pdf sdk in C# and ByteScout Premium Suite

If you want to learn more then this tutorial will show how to add show hide action to pdf with pdf sdk in C#

Quickly learn how to add show hide action to pdf with pdf sdk in C# with this sample source code. ByteScout Premium Suite: the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording. It can add show hide action to pdf with pdf sdk in C#.

This prolific sample source code in C# for ByteScout Premium Suite contains various functions and other necessary options you should do calling the API to add show hide action to pdf with pdf sdk. IF you want to implement the functionality, just copy and paste this code for C# below into your code editor with your app, compile and run your application. Applying C# application mostly includes various stages of the software development so even if the functionality works please test it with your data and the production environment.

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

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

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

Program.cs
      
using System.Diagnostics; using Bytescout.PDF; namespace ShowHideWidget { /// <summary> /// This example demonstrates how to show/hide a widget in document. /// </summary> class Program { static void Main() { // Create new document Document pdfDocument = new Document(); pdfDocument.RegistrationName = "demo"; pdfDocument.RegistrationKey = "demo"; // Add page Page page = new Page(PaperFormat.A4); pdfDocument.Pages.Add(page); // Create widget that will be shown/hidden EditBox editBox = new EditBox(20, 20, 100, 25, "editBox1"); editBox.Text = "editBox1"; page.Annotations.Add(editBox); // Create button that will show the widget PushButton buttonShow = new PushButton(20, 80, 50, 25, "buttonShow"); buttonShow.Caption = "Show"; page.Annotations.Add(buttonShow); // Add Show action HideAction showAction = new HideAction(false); showAction.Fields.Add(editBox); buttonShow.OnActivated = showAction; // Create button that will hide the widget PushButton buttonHide = new PushButton(100, 80, 50, 25, "buttonHide"); buttonHide.Caption = "Hide"; page.Annotations.Add(buttonHide); // Add Hide action HideAction hideAction = new HideAction(true); hideAction.Fields.Add(editBox); buttonHide.OnActivated = hideAction; // Save document to file pdfDocument.Save("result.pdf"); // Cleanup pdfDocument.Dispose(); // Open result document in default associated application (for demo purpose) ProcessStartInfo processStartInfo = new ProcessStartInfo("result.pdf"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } }

ON-PREMISE OFFLINE SDK

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

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 Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next