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:
        (nullable NSString *)actionNameString;

    Swift

    init(actionNamedString actionNameString: String?)
  • Initialize with a specific named action type.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithNamedActionType:
        (PSPDFNamedActionType)namedActionType;

    Swift

    init(namedActionType: PSPDFNamedActionType)
  • 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.

    Declaration

    Objective-C

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

    Swift

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

    Return Value

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