ByteScout PDF SDK - C# - Create ListBox in PDF form - ByteScout

ByteScout PDF SDK – C# – Create ListBox in PDF form

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – C# – Create ListBox in PDF form

How to create listbox in PDF form in C# and ByteScout PDF SDK

This code in C# shows how to create listbox in PDF form with this how to tutorial

The sample source codes on this page shows how to create listbox in PDF form in C#. ByteScout PDF SDK is the SDK for pdf documents generation, modification and updates. Can also generate and fill PDF forms. Provides support for text (fonts, style, size, font family), layers, pdf form fields, vector and raster drawings and you can use it to create listbox in PDF form with C#.

You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout PDF SDK for create listbox in PDF form below and use it in your application. In your C# project or application you may simply copy & paste the code and then run your app! Implementing C# application typically includes multiple stages of the software development so even if the functionality works please test it with your data and the production environment.

ByteScout PDF SDK free trial version is available on our website. C# and other programming languages are supported.

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

Program.cs
      
using System.Diagnostics; using Bytescout.PDF; namespace ListBoxes { /// <summary> /// This example demonstrates how to create a listbox. /// </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); // Add list box, add items and make it multi-selectable ListBox listBox = new ListBox(20, 20, 120, 80, "listBox1"); listBox.Items.Add("Value 1"); listBox.Items.Add("Value 2"); listBox.Items.Add("Value 3"); listBox.Items.Add("Value 4"); listBox.Items.Add("Value 5"); listBox.MultiSelect = true; // Decorate listbox listBox.Font = new Font(StandardFonts.Helvetica, 10); listBox.BorderColor = new ColorRGB(0, 0, 128); listBox.BackgroundColor = new ColorRGB(240, 240, 255); listBox.BorderWidth = 2; page.Annotations.Add(listBox); // 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); } } }

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