PSPDFChoiceFormElement

Objective-C


@interface PSPDFChoiceFormElement : PSPDFFormElement

Swift

class ChoiceFormElement : FormElement

Choice Form Element.

  • (Optional) An array of options that shall be presented to the user.

    Declaration

    Objective-C

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

    Swift

    var options: [PSPDFFormOption]? { get }
  • (Sometimes required, otherwise optional; PDF 1.4) For choice fields that allow multiple selection (MultiSelect flag set), an array of integers, sorted in ascending order, representing the zero-based indices in the Opt array of the currently selected option items. This entry shall be used when two or more elements in the Opt array have different names but the same export value or when the value of the choice field is an array. This entry should not be used for choice fields that do not allow multiple selection. If the items identified by this entry differ from those in the V entry of the field dictionary (see discussion following this Table), the V entry shall be used.

    Declaration

    Objective-C

    @property (copy, nullable) NSIndexSet *selectedIndices;

    Swift

    var selectedIndices: IndexSet? { get set }
  • If any indices are selected, returns the corresponding selected PSPDFFormOption.

    Declaration

    Objective-C

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

    Swift

    var selectedOptions: [PSPDFFormOption]? { get }
  • For combo boxes only, is the selection a default or custom value

    Declaration

    Objective-C

    @property (readonly) BOOL customSelection;

    Swift

    var customSelection: Bool { get }
  • Optional. For scrollable list boxes, the top index (the index in the Opt array of the first option visible in the list). Default value: 0.

    Declaration

    Objective-C

    @property (readonly) NSUInteger topIndex;

    Swift

    var topIndex: UInt { get }
  • Custom text.

    Declaration

    Objective-C

    @property (copy, nullable) NSString *customText;

    Swift

    var customText: String? { get set }
  • Returns the parent property formField cast to the appropriate PSPDFChoiceFormField type.

    Declaration

    Objective-C

    @property (readonly, nullable) PSPDFChoiceFormField *choiceFormField;

    Swift

    var choiceFormField: PSPDFChoiceFormField? { get }