Bookmarks
-
A bookmark encapsulates a PDF action and a name. It is managed by a document’s bookmark manager.
See
BookmarkManagerDeclaration
Objective-C
@interface PSPDFBookmark : PSPDFModel <NSCopying, NSMutableCopying, PSPDFOverridable>
Swift
class Bookmark : ModelObject, NSCopying, NSMutableCopying, Overridable
-
The
BookmarkManager
manages bookmarks for a givenDocument
.You should not initialize a bookmark manager yourself but instead access it through the document’s
bookmarkManager
property.Bookmarks and PDF files
The concept of bookmarks does not exist in a PDF document. Therefore all the bookmarks you add will be stored inside the PDF but are only read by PSPDFKit and Apple Preview. If you want to support other formats, you need to create your own bookmark provider and store them yourself.
Subclassing
You should not subclass
BookmarkManager
. Instead attach a custom bookmark provider to achieve your desired behavior.Thread Safety
BookmarkManager
is thread safe and can be accessed from any thread. To ensure multiple operations are executed as one serial block without other threads interfering, wrap you operations inperformBlock:
orperformBlockAndWait:
whenever you need to do complex operations.However, if you need to do something that can be achieved by calling a single method on this class (e.g. adding a bookmark or removing a known bookmark), call the appropriate method directly as it is more performant than wrapping calls in the above mentioned block calls.
See moreDeclaration
Objective-C
@interface PSPDFBookmarkManager : NSObject
Swift
class BookmarkManager : NSObject
-
A Bookmark Provider is used to store and read bookmarks from a data source.
If you need to store bookmarks in a file format other than what PSPDFKit supports by default, you can create your own bookmark provider and attach it to a document’s bookmark manager.
See
BookmarkManagerSee
PSPDFBookmarksChangedNotification for change notifications.Declaration
Objective-C
@protocol PSPDFBookmarkProvider <NSObject>
Swift
protocol BookmarkProvider : NSObjectProtocol
-
Custom cell used for bookmarks.
See moreDeclaration
Objective-C
@interface PSPDFBookmarkCell : PSPDFThumbnailTextCell <UITextFieldDelegate, PSPDFOverridable>
Swift
class BookmarkCell : ThumbnailTextCell, UITextFieldDelegate, Overridable
-
Custom
See moreUIButton
that sets the appropriate bookmark image based onimageType
, and applies a shadow as well. The image will always have a tint applied to it, based on thenormalTintColor
andselectedTintColor
properties These colors can be customized using regularUIAppearance
APIs. To customize the appearance even further, your can use the custom image loading API to change the images.Declaration
Objective-C
@interface PSPDFBookmarkIndicatorButton : UIButton <PSPDFOverridable>
Swift
class BookmarkIndicatorButton : UIButton, Overridable
-
Show list of bookmarks for the current document and allows editing/reordering of the bookmarks.
See moreDeclaration
Objective-C
@interface PSPDFBookmarkViewController : PSPDFStatefulTableViewController < PSPDFBookmarkTableViewCellDelegate, PSPDFDocumentInfoController, PSPDFSegmentImageProviding, PSPDFStyleable, PSPDFOverridable>
Swift
class BookmarkViewController : StatefulTableViewController, BookmarkTableViewCellDelegate, DocumentInfoController, SegmentImageProviding, Styleable, Overridable
-
Table view cell that shows a thumbnail image along with a few text elements.
See moreDeclaration
Objective-C
@interface PSPDFThumbnailTextCell : PSPDFNonAnimatingTableViewCell
Swift
class ThumbnailTextCell : NonAnimatingTableViewCell