PSPDFFormElement

Objective-C


@interface PSPDFFormElement : PSPDFWidgetAnnotation

Swift

class FormElement : WidgetAnnotation

Represents a PDF form element.

  • Returns the form field linked to this annotation.

    Declaration

    Objective-C

    @property (weak, readonly) PSPDFFormField *_Nullable formField;

    Swift

    weak var formField: PSPDFFormField? { get }
  • Returns true if we can reset this form element to default values.

    Declaration

    Objective-C

    @property (readonly, getter=isResettable) BOOL resettable;

    Swift

    var isResettable: Bool { get }
  • (Optional; inheritable) The default value to which the field reverts when a reset-form action is executed (see 12.7.5.3, “Reset-Form Action”). The format of this value is the same as that of V.

    Declaration

    Objective-C

    @property (readonly, nullable) id defaultValue;

    Swift

    var defaultValue: Any? { get }
  • The value which the field is to export when submitted. Can return either a string or an array of strings in the case of multiple selection.

    Declaration

    Objective-C

    @property (readonly, nullable) id exportValue;

    Swift

    var exportValue: Any? { get }
  • Color when the annotation is being highlighted.

    Note

    PSPDFKit extension. Won’t be saved into the PDF.

    Declaration

    Objective-C

    @property (nullable) UIColor *highlightColor;

    Swift

    var highlightColor: UIColor? { get set }
  • The previous control in tab order.

    Declaration

    Objective-C

    @property (weak) PSPDFFormElement *_Nullable next;

    Swift

    weak var next: FormElement? { get set }
  • The next control in tab order.

    Declaration

    Objective-C

    @property (weak) PSPDFFormElement *_Nullable previous;

    Swift

    weak var previous: FormElement? { get set }
  • Position of the receiver in the form calculation order list (used when a form with JavaScript scripts must be recalculated). An index of 0 is the first position in that list, an index of 1 is the second position, and so on. For example, if the receiver is the first form field that is recalculated in a form document, then this property has a value of 0.

    Declaration

    Objective-C

    @property (readonly) NSUInteger calculationOrderIndex;

    Swift

    var calculationOrderIndex: UInt { get }
  • If set, the user may not change the value of the field. Any associated widget annotations will not interact with the user; that is, they will not respond to mouse clicks or change their appearance in response to mouse motions. This flag is useful for fields whose values are computed or imported from a database. This reflects the set value for this property on the linked formField.

    Declaration

    Objective-C

    @property (readonly, getter=isReadOnly) BOOL readOnly;

    Swift

    var isReadOnly: Bool { get }
  • If set, the field shall have a value at the time it is exported by a submit- form action (see 12.7.5.2, “Submit-Form Action”). This reflects the set value for this property on the linked formField.

    Partially supported. A border will be shown around required elements according to requiredFormBorderColor in the RenderOptions, but PSPDFKit will not ensure all required fields are filled before executing a submit form action.

    Declaration

    Objective-C

    @property (readonly, getter=isRequired) BOOL required;

    Swift

    var isRequired: Bool { get }
  • If set, the field shall not be exported by a submit-form action (see 12.7.5.2, “Submit-Form Action”). This reflects the set value for this property on the linked formField.

    Not supported. PSPDFKit will read this flag from the PDF and write back changes to its state, but otherwise this flag has no effect on PSPDFKit.

    Declaration

    Objective-C

    @property (readonly, getter=isNoExport) BOOL noExport;

    Swift

    var isNoExport: Bool { get }
  • A partial name for this form element based on the partial form field name.

    In the case of multiple elements being associated with the same form field (e.g. for multiple choice buttons) this property will have a number component appended for disambiguation.

    Don’t use this property if you want the form field name. Use formField.name instead.

    Declaration

    Objective-C

    @property (readonly, nullable) NSString *fieldName;

    Swift

    var fieldName: String? { get }
  • A full name for this form element based on the full name for the associated form field.

    In the case of multiple elements being associated with the same form field (e.g. for multiple choice buttons) this property will have a number component appended for disambiguation.

    Don’t use this property if you want the fully qualified form field name. Use formField.fullyQualifiedName instead.

    Declaration

    Objective-C

    @property (readonly, nullable) NSString *fullyQualifiedFieldName;

    Swift

    var fullyQualifiedFieldName: String? { get }
  • Returns the Form Type Name. “Form Element”, “Text Field” etc

    Declaration

    Objective-C

    @property (readonly) NSString *_Nonnull formTypeName;

    Swift

    var formTypeName: String { get }
  • The maximum length of the field’s text, in characters. (Optional; inheritable)

    Declaration

    Objective-C

    @property NSUInteger maxLength;

    Swift

    var maxLength: UInt { get set }
  • Whether the text field should scroll with it’s content.

    (PDF 1.4) If set, the field shall not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. Once the field is full, no further text shall be accepted for interactive form filling; for non- interactive form filling, the filler should take care not to add more character than will visibly fit in the defined area.

    Declaration

    Objective-C

    @property BOOL doNotScroll;

    Swift

    var doNotScroll: Bool { get set }
  • Properties for rendering

    Declaration

    Objective-C

    @property BOOL isMultiline;

    Swift

    var isMultiline: Bool { get set }