Class: RadioButtonGroup

PDFNet. RadioButtonGroup


new RadioButtonGroup()

An object representing a Group of Radio Buttons that can be used to create new Radio Buttons. If a group contains multiple buttons they will be connected.

Extends

Methods


<static> create(doc [, field_name])

Creates a new RadioButtonGroup in the specified document.
Parameters:
Name Type Argument Description
doc PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc The document in which the RadioButtonGroup is created.
field_name string <optional>
The name of the field to create and use in this RadioButtonGroup.
Returns:
A promise that resolves to a newly created RadioButtonGroup.
Type
Promise.<PDFNet.RadioButtonGroup>

<static> createFromField(field)

Creates a RadioButtonGroup and initialize it using given Field object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Parameters:
Name Type Description
field PDFNet.Field The field with which to initialize the RadioButtonGroup
Returns:
A promise that resolves to an object of type: "PDFNet.RadioButtonGroup"
Type
Promise.<PDFNet.RadioButtonGroup>

add(pos [, onstate])

Adds a new RadioButtonWidget to the RadioButtonGroup
Parameters:
Name Type Argument Description
pos PDFNet.Rect A rectangle specifying the annotation's bounds, specified in user space coordinates.
onstate string <optional>
The onstate for this button. This will rarely need to be explicitly set. However, it can be used to allow multiple radiobuttons in a group to be on at once if they have the same onstate.
Returns:
A promise that resolves to a newly created default RadioButtonWidget.
Type
Promise.<PDFNet.RadioButtonWidget>

addGroupButtonsToPage(page)

Add all group buttons to the page
Parameters:
Name Type Description
page PDFNet.Page The page in which to add the buttons.
Returns:
Type
Promise.<void>

copy()

Copy Constructor
Returns:
A promise that resolves to an object of type: "PDFNet.RadioButtonGroup"
Type
Promise.<PDFNet.RadioButtonGroup>

destroy()

Destructor
Inherited From:
Returns:
Type
Promise.<void>

getButton(index)

Retrieves the button at a given index.
Parameters:
Name Type Description
index number The index to use.
Returns:
A promise that resolves to the RadioButtonWidget at the given index
Type
Promise.<PDFNet.RadioButtonWidget>

getField()

Gets the field associated with this RadioButtonGroup
Returns:
A promise that resolves to the Field associated with this RadioButtonGroup
Type
Promise.<PDFNet.Field>

getNumButtons()

Gets the number of buttons in this RadioButtonGroup
Returns:
A promise that resolves to the number of buttons in this RadioButtonGroup
Type
Promise.<number>

takeOwnership()

Take the ownership of this object, so that PDFNet.runWithCleanup won't destroy this object.
Inherited From:
Returns:
Type
void