PSPDFButtonFormElement

Objective-C


@interface PSPDFButtonFormElement : PSPDFFormElement <NSSecureCoding>

Swift

class ButtonFormElement : FormElement, NSSecureCoding

Button Form Element (check boxes, radio buttons, regular form push buttons)

  • Returns true if button is selected.

    Declaration

    Objective-C

    @property (readonly, getter=isSelected) BOOL selected;

    Swift

    var isSelected: Bool { get }
  • (Optional; inheritable; PDF 1.4) An array containing one entry for each widget annotation in the Kids array of the radio button or check box field. Each entry shall be a text string representing the on state of the corresponding widget annotation. When this entry is present, the names used to represent the on state in the AP dictionary of each annotation (for example, /1, /2) numerical position (starting with 0) of the annotation in the Kids array, encoded as a name object. This allows distinguishing between the annotations even if two or more of them have the same value in the Opt array.

    Declaration

    Objective-C

    @property (copy, readonly, nullable) NSArray<PSPDFFormOption *> *options;

    Swift

    var options: [PSPDFFormOption]? { get }
  • The appearance state to be used in the ‘on’ position. This will be a key in the dictionary of appearance streams for the different states. The off state is always “Off”.

    Declaration

    Objective-C

    @property (copy, readonly, nullable) NSString *onState;

    Swift

    var onState: String? { get }
  • Returns the parent property formField cast to the appropriate PSPDFButtonFormField type.

    Declaration

    Objective-C

    @property (readonly, nullable) PSPDFButtonFormField *buttonFormField;

    Swift

    var buttonFormField: PSPDFButtonFormField? { get }
  • Select the button.

    Declaration

    Objective-C

    - (void)select;

    Swift

    func select()
  • Deselect the button.

    Declaration

    Objective-C

    - (void)deselect;

    Swift

    func deselect()
  • Toggle button selection state.

    Declaration

    Objective-C

    - (BOOL)toggleButtonSelectionState;

    Swift

    func toggleButtonSelectionState() -> Bool

    Return Value

    YES if toggled, NO otherwise.