PSPDFTextFieldFormElement


@interface PSPDFTextFieldFormElement : PSPDFFormElement

Text field form element.

  • If set, the field may contain multiple lines of text; if clear, the field’s text shall be restricted to a single line. - note: Evaluates PSPDFTextFieldFlagMultiline in the fieldFlags.

    Declaration

    Objective-C

    @property (readonly, getter=isMultiline, nonatomic) BOOL multiline;

    Swift

    var isMultiline: Bool { get }
  • If set, the field is intended for entering a secure password that should not be echoed visibly to the screen. - note: Evaluates PSPDFTextFieldFlagPassword in the fieldFlags.

    Declaration

    Objective-C

    @property (readonly, getter=isPassword, nonatomic) BOOL password;

    Swift

    var isPassword: Bool { get }
  • Handles Keystroke, Validate and Calculate actions that follow from user text input automatically. isFinal defines if the user is typing (NO) or if the string should be committed (YES). The change is the change in text. Returns the new text contents (possibly different from the passed change) to be applied. Otherwise, if failed, returns nil.

    Declaration

    Objective-C

    - (nullable NSString *)
    textFieldChangedWithContents:(nonnull NSString *)contents
                          change:(nonnull NSString *)change
                           range:(NSRange)range
                         isFinal:(BOOL)isFinal
                     application:(nullable id<PSPDFApplicationJSExport>)application
                           error:(NSError *_Nullable *_Nullable)validationError;

    Swift

    func textFieldChanged(withContents contents: String, change: String, range: NSRange, isFinal: Bool, application: PSPDFApplicationJSExport?) throws -> String
  • Returns the contents formatted based on rules in the annotation (including JavaScript)

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSString *formattedContents;

    Swift

    var formattedContents: String? { get }
  • The input format. Some forms are number/date/time specific.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFTextInputFormat inputFormat;

    Swift

    var inputFormat: PSPDFTextInputFormat { get }
  • Returns the parent property formField cast to the appropriate PSPDFTextFormField type.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) PSPDFTextFormField *textFormField;

    Swift

    var textFormField: PSPDFTextFormField? { get }