Class ComboBoxWidget
An object representing a combo box used in a PDF Form.
Implements
Inherited Members
Namespace: pdftron.PDF.Annots
Assembly: PDFTronDotNet.dll
Syntax
public class ComboBoxWidget : Widget, IDisposable
Constructors
ComboBoxWidget(Annot)
Creates a Widget annotation and initialize it using given annotation object.
Declaration
public ComboBoxWidget(Annot ann)
Parameters
Type | Name | Description |
---|---|---|
Annot | ann | The annotation object to use. |
Remarks
The constructor does not copy any data, but is instead the logical equivalent of a type cast.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
ComboBoxWidget(Obj)
Creates a Combo Box Widget annotation and initialize it using given Cos/SDF object.
Declaration
public ComboBoxWidget(Obj d)
Parameters
Type | Name | Description |
---|---|---|
Obj | d | the object to use to initialize the ComboBoxWidget |
Remarks
The constructor does not copy any data, but is instead the logical equivalent of a type cast.
Methods
AddOption(string)
Add an option to Combo Box widget.
Declaration
public void AddOption(string option)
Parameters
Type | Name | Description |
---|---|---|
string | option | The option to add |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
AddOptions(string[])
Adds multiple options to Combo Box widget.
Declaration
public void AddOptions(string[] opts)
Parameters
Type | Name | Description |
---|---|---|
string[] | opts | The options to add |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Create(PDFDoc, Rect)
Creates a new Combo Box Widget annotation, in the specified document with a default Field name.
Declaration
public static ComboBoxWidget Create(PDFDoc doc, Rect pos)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | doc | The document to which the annotation is added. |
Rect | pos | A rectangle specifying the annotation's bounds, specified in user space coordinates. |
Returns
Type | Description |
---|---|
ComboBoxWidget | A newly created blank Widget annotation. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Create(PDFDoc, Rect, string)
Creates a new Combo Box Widget annotation, in the specified document.
Declaration
public static ComboBoxWidget Create(PDFDoc doc, Rect pos, string field_name)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | doc | The document to which the annotation is added. |
Rect | pos | A rectangle specifying the annotation's bounds, specified in user space coordinates. |
string | field_name | The name of the field for which to create a ComboBox widget |
Returns
Type | Description |
---|---|
ComboBoxWidget | A newly created blank Widget annotation. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Create(PDFDoc, Rect, Field)
Creates a new Combo Box Widget annotation, in the specified document.
Declaration
public static ComboBoxWidget Create(PDFDoc doc, Rect pos, Field field)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | doc | The document to which the annotation is added. |
Rect | pos | A rectangle specifying the annotation's bounds, specified in user space coordinates. |
Field | field | The field for which to create a Text widget |
Returns
Type | Description |
---|---|
ComboBoxWidget | A newly created blank Widget annotation. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetSelectedOption()
Retrieves the option selected in the ComboBox widget
Declaration
public string GetSelectedOption()
Returns
Type | Description |
---|---|
string | The option selected in the ComboBox widget |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetSelectedOption(string)
Selects the given option in the Combo Box widget
Declaration
public void SetSelectedOption(string option)
Parameters
Type | Name | Description |
---|---|---|
string | option | The option to select |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |