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
namestringA unique field name, without dots.
xdoubleLeft edge of the field, in points.
ydoubleBottom edge of the field, in points.
widthdoubleField width, in points.
heightdoubleField height, in points; options that do not fit are reached by scrolling.
optionsIEnumerable<string>The choices, in display order; at least one.
selectedstringThe initially selected choice, or null for none.
Returns
- PdfListBox
The list box.
Exceptions
- ArgumentException
The name is invalid or used, or
optionsis empty.- InvalidOperationException
The document was created for PDF/A, where form fields are not supported yet.