PSPDFAction


@interface PSPDFAction : PSPDFModel <NSSecureCoding>

Defines an action that is defined in the PDF spec, either from an outline or an annotation object. See the Adobe PDF Specification for more about actions and action types.

Note

The PDF spec defines both ‘destinations’ and ‘actions’. PSPDFKit will convert a ‘destination’ into an equivalent PSPDFActionTypeGoTo.
  • The PDF action type.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFActionType type;

    Swift

    var type: PSPDFActionType { get }
  • The actions parent action. Only set if it is a subAction of another action. Automatically set when assigning subActions on the parent action.

    Declaration

    Objective-C

    @property (readonly, atomic) PSPDFAction *_Nullable parentAction;

    Swift

    weak var parent: PSPDFAction? { get }
  • PDF actions can be chained together. Defines the sub actions.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        NSArray<PSPDFAction *> *_Nonnull subActions;

    Swift

    var subActions: [PSPDFAction] { get set }
  • If the action contained a pspdfkit:// URL, options between the URL will be parsed and extracted as key/value. Can also be used for generic key/value storage (but remember that PSPDFActions usually are regenerated when using any of the convenience setters) Will be persisted externally but not within PDF documents.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSDictionary<NSString *, id> *options;

    Swift

    var options: [String : Any]? { get }
  • Returns the most appropriate description (Like Page 3 or http://google.com) for the action.

    Declaration

    Objective-C

    - (nonnull NSString *)localizedDescriptionWithDocumentProvider:
        (nullable PSPDFDocumentProvider *)documentProvider;

    Swift

    func localizedDescription(with documentProvider: PSPDFDocumentProvider?) -> String

    Parameters

    documentProvider

    Used to resolve named destinations and page labels. (Optional)