PSPDFFormElement


@interface PSPDFFormElement : PSPDFWidgetAnnotation

Represents a PDF form element.

  • Returns the form field linked to this annotation.

    Declaration

    Objective-C

    @property (readonly, nonatomic) 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, nonatomic) 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, nonatomic, 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, nonatomic, 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 (assign, readwrite, nonatomic, nullable) UIColor *highlightColor;

    Swift

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

    Declaration

    Objective-C

    @property (readwrite, nonatomic) PSPDFFormElement *_Nullable next;

    Swift

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

    Declaration

    Objective-C

    @property (readwrite, nonatomic) PSPDFFormElement *_Nullable previous;

    Swift

    weak var previous: PSPDFFormElement? { get set }
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFFormElement : PSPDFWidgetAnnotation
  • 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 is set by the PDF file and can’t be changed by PSPDFKit. See isEditable for disabling interaction with the form element.

    Declaration

    Objective-C

    @property (readonly, getter=isReadOnly, nonatomic) 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 is set by the PDF file and can’t be changed by PSPDFKit.

    Declaration

    Objective-C

    @property (readonly, getter=isRequired, nonatomic) 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 is set by the PDF file and can’t be changed by PSPDFKit.

    Declaration

    Objective-C

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

    Swift

    var isNoExport: Bool { get }
  • The partial field name.

    Declaration

    Objective-C

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

    Swift

    var fieldName: String? { get }
  • The T entry in the field dictionary (see Table 220) holds a text string defining the field’s partial field name. The fully qualified field name is not explicitly defined but shall be constructed from the partial field names of the field and all of its ancestors. For a field with no parent, the partial and fully qualified names are the same. For a field that is the child of another field, the fully qualified name shall be formed by appending the child field’s partial name to the parent’s fully qualified name, separated by a PERIOD (2Eh) — PDF Spec

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull formTypeName;

    Swift

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

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSUInteger maxLength;

    Swift

    var maxLength: UInt { get set }
  • Properties for rendering

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL isMultiline;

    Swift

    var isMultiline: Bool { get set }
  • Draws the form highlight.

    Declaration

    Objective-C

    - (void)drawHighlightInContext:(nonnull CGContextRef)context
                           options:(nullable NSDictionary *)renderOptions
                          multiply:(BOOL)shouldMultiply;

    Swift

    func drawHighlight(in context: CGContext, options renderOptions: [AnyHashable : Any]? = nil, multiply shouldMultiply: Bool)