PSPDFButtonFormField


@interface PSPDFButtonFormField : PSPDFFormField

Represents one button form field in a PDF form. They come in three variants: - A push button that can have a action attached to it. - A check box that can be independently checked or unchecked. - A radio button that are mutually exclusive.

A PSPDFButtonFormField can be the parent of multiple buttons, like a RadioButton group.

  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFButtonFormField : PSPDFFormField
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFButtonFormField : PSPDFFormField
  • A push button is a purely interactive control that responds immediately to user input without retaining a permanent value (see 12.7.4.2.2, “Pushbuttons”).

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL isPushButton;

    Swift

    var isPushButton: Bool { get }
  • A check box toggles between two states, on and off (see 12.7.4.2.3, “Check Boxes”).

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL isCheckBox;

    Swift

    var isCheckBox: Bool { get }
  • Radio button fields contain a set of related buttons that can each be on or off. Typically, at most one radio button in a set may be on at any given time, and selecting any one of the buttons automatically deselects all the others. (There are exceptions to this rule, as noted in Radio Buttons.)

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL isRadioButton;

    Swift

    var isRadioButton: Bool { get }
  • A set of selected annotation object numbers.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        NSArray<NSNumber *> *_Nonnull selectedAnnotationObjectNumbers;

    Swift

    var selectedAnnotationObjectNumbers: [NSNumber] { get set }
  • (Optional) An array of options that shall be presented to the user.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic)
        NSArray<PSPDFFormOption *> *_Nonnull 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

    - (nullable NSString *)onStateForButton:
        (nonnull PSPDFWidgetAnnotation *)annotation;

    Swift

    func onState(forButton annotation: PSPDFWidgetAnnotation) -> String?
  • Toggles the button state.

    Declaration

    Objective-C

    - (void)toggleButton:(nonnull PSPDFWidgetAnnotation *)annotation;

    Swift

    func toggleButton(_ annotation: PSPDFWidgetAnnotation)

    Parameters

    annotation

    The annotation representing the button.

  • Checks if the given annotation is selected.

    Declaration

    Objective-C

    - (BOOL)isSelected:(nonnull PSPDFWidgetAnnotation *)annotation;

    Swift

    func isSelected(_ annotation: PSPDFWidgetAnnotation) -> Bool

    Parameters

    annotation

    The annotation representing the button.

    Return Value

    YES if selected, NO otherwise.

  • Selects the button.

    Declaration

    Objective-C

    - (void)selectButton:(nonnull PSPDFWidgetAnnotation *)annotation;

    Swift

    func selectButton(_ annotation: PSPDFWidgetAnnotation)

    Parameters

    annotation

    The annotation representing the button.

  • Deselects the button.

    Declaration

    Objective-C

    - (void)deselectButton:(nonnull PSPDFWidgetAnnotation *)annotation;

    Swift

    func deselectButton(_ annotation: PSPDFWidgetAnnotation)

    Parameters

    annotation

    The annotation representing the button.

  • Gets the value of the button.

    Declaration

    Objective-C

    - (nullable NSString *)valueForButton:
        (nonnull PSPDFWidgetAnnotation *)annotation;

    Swift

    func value(forButton annotation: PSPDFWidgetAnnotation) -> String?

    Parameters

    annotation

    The annotation representing the button.