PSPDFNamedAction
Objective-C
@interface PSPDFNamedAction : PSPDFAction
Swift
class NamedAction : Action
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: NamedActionType)
-
The type of the named action.
Note
Will updatenamedAction
if set.Declaration
Objective-C
@property (nonatomic, readonly) PSPDFNamedActionType namedActionType;
Swift
var namedActionType: NamedActionType { get }
-
The string of the named action.
Note
Will updatenamedActionType
if set.Declaration
Objective-C
@property (nonatomic, copy, readonly, nullable) NSString *namedAction;
Swift
var namedAction: String? { get }
-
Returns the target page for certain named actions.
The named actions supported by this method are
.nextPage
,.previousPage
,.firstPage
, andlastPage
. For other types this will returnNSNotFound
. This also returnsNSNotFound
if the provided current page is out of bounds or if the target page would be out of bounds. This will not resolve the target page index forgoBack
andgoForward
actions because the navigation history is part of the UI rather than part of the model. It will returnNSNotFound
for those.Declaration
Objective-C
- (PSPDFPageIndex)pageIndexWithCurrentPage:(PSPDFPageIndex)currentPage fromDocument:(nonnull PSPDFDocument *)document;
Swift
func pageIndex(withCurrentPage currentPage: PageIndex, from document: PSPDFDocument) -> PageIndex
Return Value
The target page, or
NSNotFound
if there is no target page.