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

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 IEnumerable<string>

The choices, in display order; at least one.

selected string

The 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 options is empty.

InvalidOperationException

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