Method AddDropdown
- Namespace
- SoftZenPdf
- Assembly
- SoftZenPdf.dll
AddDropdown(string, double, double, double, double, IEnumerable<string>, string?)
Adds a dropdown list (combo box).
public PdfComboBox AddDropdown(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.
optionsIEnumerable<string>The choices, in display order; at least one.
selectedstringThe initially selected choice, or null for none.
Returns
- PdfComboBox
The dropdown; set Editable to also allow free text.
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.