Method AddListBox

Namespace
SoftZenPdf
Assembly
SoftZenPdf.dll

AddListBox(string, double, double, double, double, IEnumerable<string>, string?)

Adds a scrollable list box; set MultiSelect to allow several selections.

public PdfListBox AddListBox(string name, double x, double y, double width, double height, IEnumerable<string> options, string? selected = null)

Parameters

name string

A unique field name, without dots.

x double

Left edge of the field, in points.

y double

Bottom edge of the field, in points.

width double

Field width, in points.

height double

Field height, in points; options that do not fit are reached by scrolling.

options IEnumerable<string>

The choices, in display order; at least one.

selected string

The initially selected choice, or null for none.

Returns

PdfListBox

The list box.

Exceptions

ArgumentException

The name is invalid or used, or options is empty.

InvalidOperationException

The document was created for PDF/A, where form fields are not supported yet.