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.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
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); } } }
60 Day Free Trial or Visit ByteScout PDF SDK Home Page
Explore ByteScout PDF SDK Documentation
Explore Samples
Sign Up for ByteScout PDF SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout PDF SDK Home Page
Explore ByteScout PDF SDK Documentation
Explore Samples
Sign Up for ByteScout PDF SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: