PSPDFNamedAction


@interface PSPDFNamedAction : PSPDFAction

Defines methods used to work with actions in PDF documents, some of which are named in the Adobe PDF Specification.

  • Initialize with string. Will parse action, set to PSPDFNamedActionTypeUnknown if not recognized or nil.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithActionNamedString:
        (NSString *_Nullable)actionNameString;

    Swift

    init(actionNamedString actionNameString: String?)
  • The type of the named action. - note: Will update namedAction if set.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFNamedActionType namedActionType;

    Swift

    var namedActionType: PSPDFNamedActionType { get }
  • The string of the named action. - note: Will update namedActionType if set.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *namedAction;

    Swift

    var namedAction: String? { get }
  • Certain action types (PSPDFActionTypeNamed) calculate the target page dynamically from the current page. - returns: The calculated page or NSNotFound if action doesn’t specify page manipulation (like PSPDFNamedActionTypeFind)

    Declaration

    Objective-C

    - (NSUInteger)pageIndexWithCurrentPage:(NSUInteger)currentPage
                              fromDocument:(nonnull PSPDFDocument *)document;

    Swift

    func pageIndex(withCurrentPage currentPage: UInt, from document: PSPDFDocument) -> UInt

    Return Value

    The calculated page or NSNotFound if action doesn’t specify page manipulation (like PSPDFNamedActionTypeFind)