PSPDFBookmark


@interface PSPDFBookmark : PSPDFModel <NSCopying, NSMutableCopying>

A bookmark encapsulates a PDF action and a name. It is managed by a document’s bookmark manager.

See

PSPDFBookmarkManager
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFBookmark : PSPDFModel <NSCopying, NSMutableCopying>
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFBookmark : PSPDFModel <NSCopying, NSMutableCopying>
  • Initialize with an action object. - note: Subclassing: This might not be called when bookmarks are created internally from the PDF.

    Declaration

    Objective-C

    - (nullable instancetype)initWithAction:(nonnull PSPDFAction *)action;

    Swift

    init?(action: PSPDFAction)
  • Initialize a bookmark that was previously serialized with a coder.

    Declaration

    Objective-C

    - (nullable instancetype)initWithCoder:(nonnull NSCoder *)aDecoder;

    Swift

    init?(coder aDecoder: NSCoder)

    Parameters

    aDecoder

    The decoder to decode the bookmark data.

    Return Value

    The decoded bookmark object or nil if decoding was not possible.

  • The PDF action. Usually this will be of type PSPDFGoToAction, but all action types are possible.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) PSPDFAction *_Nonnull action;

    Swift

    @NSCopying var action: PSPDFAction { get }
  • A bookmark can have a name. This is optional.

    Declaration

    Objective-C

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

    Swift

    var name: String? { get }
  • Contains the name of the bookmark or, if the bookmark does not have a valid name, a suitable description for the action of this bookmark.

    Typically this method is used to represent the bookmark in the UI.

    Declaration

    Objective-C

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

    Swift

    var displayName: String { get }
  • A string uniquely identifying the bookmark.

    Two bookmarks with an equal identifier are considered equal.

    Note

    You should treat this as an opaque value and don’t make any assumptions about it. This property is just ment for custom bookmark providers to properly store a bookmark.

    Declaration

    Objective-C

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

    Swift

    var identifier: String { get }
  • A number used for the custom sorting option.

    Note

    You should treat this as an opaque value and don’t make any assumptions about it. This property is just ment for custom bookmark providers to properly store a bookmark.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSNumber *sortKey;

    Swift

    var sortKey: NSNumber? { get }
  • Initializes a new bookmark with the given identifier, action, name and sort key.

    This initializer is ment to be used from inside a bookmark provider only, when loading bookmarks.

    Warning

    Only pass values into the identifier and sortKey initializer that you previously got from another bookmark during a save operation. Passing other values to this identifier leads to undefined behavior.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithIdentifier:(nonnull NSString *)identifier
                                        action:(nonnull PSPDFAction *)action
                                          name:(nullable NSString *)name
                                       sortKey:(nullable NSNumber *)sortKey;

    Swift

    convenience init(identifier: String, action: PSPDFAction, name: String?, sortKey: NSNumber?)

    Parameters

    identifier

    The identifier of a bookmark, previously read from a bookmark’s identifier property.

    action

    The action the bookmark executes when selected.

    name

    The name of the bookmark or nil if the bookmark does not have a name.

    sortKey

    The sortKey of a bookmark, previously read from a bookmark’s sortKey property or nil.

    Return Value

    A new, fully configured instance of a bookmark.

  • Initialize with page. Convenience initialization that will create a PSPDFGoToAction.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPageIndex:(NSUInteger)pageIndex;

    Swift

    convenience init(pageIndex: UInt)
  • Convenience shortcut for self.action.pageIndex (if action is of type PSPDFGoToAction) Page is set to NSNotFound if action is nil or a different type.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSUInteger pageIndex;

    Swift

    var pageIndex: UInt { get }