Other Constants

The following constants are available globally.

  • Prefix used for all analytics events. “pspdf”. A underscore (_) is added after this prefix to all analytics events as well.

    Declaration

    Objective-C

    extern NSString *const PSPDFAnalyticsEventPrefix

    Swift

    let PSPDFAnalyticsEventPrefix: String
  • Show annotation creator dialog event. This signifies that the annotation creator dialog was shown to the user. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName
        PSPDFAnalyticsEventNameAnnotationCreatorDialogShow

    Swift

    static let annotationCreatorDialogShow: PDFAnalytics.EventName
  • Cancel annotation creator dialog event. Signifies that the annotation creator dialog was cancelled by the user. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName
        PSPDFAnalyticsEventNameAnnotationCreatorDialogCancel

    Swift

    static let annotationCreatorDialogCancel: PDFAnalytics.EventName
  • Set annotation creator event. Signifies that the annotation creator dialog was confirmed by the user, setting a creator name. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName PSPDFAnalyticsEventNameAnnotationCreatorSet

    Swift

    static let annotationCreatorSet: PDFAnalytics.EventName
  • Show annotation inspector event. This signifies that the user has opened the annotation inspector for editing annotation properties, either via the annotation toolbar or by editing an existing annotation. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName
        PSPDFAnalyticsEventNameAnnotationInspectorShow

    Swift

    static let annotationInspectorShow: PDFAnalytics.EventName
  • Select text event. This signifies that the user has selected text on the document. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName PSPDFAnalyticsEventNameTextSelect

    Swift

    static let textSelect: PDFAnalytics.EventName
  • Add bookmark event. This signifies that the user added a bookmark to the document. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName PSPDFAnalyticsEventNameBookmarkAdd

    Swift

    static let bookmarkAdd: PDFAnalytics.EventName
  • Edit bookmarks event. This signifies that the user has entered bookmark editing mode inside the bookmark list. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName PSPDFAnalyticsEventNameBookmarkEdit

    Swift

    static let bookmarkEdit: PDFAnalytics.EventName
  • Delete bookmark event. This signifies that the user has deleted a bookmark from the document. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName PSPDFAnalyticsEventNameBookmarkRemove

    Swift

    static let bookmarkRemove: PDFAnalytics.EventName
  • Sort bookmark event. This signifies that the user changed moved the order of a bookmark item in the bookmark list. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName PSPDFAnalyticsEventNameBookmarkSort

    Swift

    static let bookmarkSort: PDFAnalytics.EventName
  • Rename bookmark event. This signifies that the user renamed a bookmark. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName PSPDFAnalyticsEventNameBookmarkRename

    Swift

    static let bookmarkRename: PDFAnalytics.EventName
  • Select bookmark event. This signigies that the user tapped a bookmark in the bookmark list. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName PSPDFAnalyticsEventNameBookmarkSelect

    Swift

    static let bookmarkSelect: PDFAnalytics.EventName
  • Start search event. This signifies that the user started a search in the document by pressing the search icon (or any other way). No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName PSPDFAnalyticsEventNameSearchStart

    Swift

    static let searchStart: PDFAnalytics.EventName
  • Search result select event. This signifies that the user selected a search result after searching the document. No attributes.

    Declaration

    Objective-C

    extern const PSPDFAnalyticsEventName PSPDFAnalyticsEventNameSearchResultSelect

    Swift

    static let searchResultSelect: PDFAnalytics.EventName
  • Option indicating if glyphs should be extracted. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionExtractGlyphs

    Swift

    static let extractGlyphs: Document.ObjectFinderOption
  • Option indicating if full PSPDFWords should be extracted. Implies PSPDFObjectFinderOptionExtractText. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionExtractWords

    Swift

    static let extractWords: Document.ObjectFinderOption
  • Option indicating if text should be extracted. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionExtractText

    Swift

    static let extractText: Document.ObjectFinderOption
  • Option indicating if text blocks should be extracted. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionExtractTextBlocks

    Swift

    static let extractTextBlocks: Document.ObjectFinderOption
  • Option indicating if image info should be extracted. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionExtractImages

    Swift

    static let extractImages: Document.ObjectFinderOption
  • Option indicating if annotations should be extracted. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionExtractAnnotations

    Swift

    static let extractAnnotations: Document.ObjectFinderOption
  • Ignore large text blocks that are > 90% of a page. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionIgnoreLargeTextBlocks

    Swift

    static let ignoreLargeTextBlocks: Document.ObjectFinderOption
  • Include annotations of attached type. (Type: PSPDFAnnotationType wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionAnnotationTypes

    Swift

    static let annotationTypes: Document.ObjectFinderOption
  • Special case; used for PSPDFAnnotationTypeNote hit testing. (Type: CGRect wrapped in NSValue)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionAnnotationPageBounds

    Swift

    static let annotationPageBounds: Document.ObjectFinderOption
  • Special case; Used to correctly hit test zoom-invariant annotations. (Type: CGFloat wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionPageZoomLevel

    Swift

    static let pageZoomLevel: Document.ObjectFinderOption
  • Option indicating if annotations that are part of a group should be included. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionAnnotationIncludedGrouped

    Swift

    static let annotationIncludedGrouped: Document.ObjectFinderOption
  • Will sort words/annotations (smaller words/annotations first). Use for touch detection. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionSmartSort

    Swift

    static let smartSort: Document.ObjectFinderOption
  • Will use path-based hit-testing based on the center point if set. All annotations that support path based hit-testing but fail the test will be excluded from the results. (Type: CGFloat wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionMinDiameter

    Swift

    static let minDiameter: Document.ObjectFinderOption
  • Will look at the text flow and select full sentences, not just what’s within the rect. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionTextFlow

    Swift

    static let textFlow: Document.ObjectFinderOption
  • Will stop after finding the first matching object. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionFindFirstOnly

    Swift

    static let findFirstOnly: Document.ObjectFinderOption
  • Only relevant for rect. Will test for intersection instead of objects that are fully included in the pdfRect. Defaults to YES if not set. (Type: Boolean wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionTestIntersection

    Swift

    static let testIntersection: Document.ObjectFinderOption
  • Only relevant if PSPDFObjectFinderOptionTestIntersection is set to YES. Test succeeds if the fraction of the overlapping area between the object and pdfRect is greater than the fraction set here. Defaults to 0 if not set, which means the test succeeds if there is any intersection at all. Valid values: 0 - 1.

    @note: The overlap is calculated w.r.t the total area. So, if ao is the area of the object, ap is the area of pdfRect and ai is the intersecting area, then the overlap proportion would be ai / (ao + ap - ai). (Type: double wrapped in NSNumber)

    Declaration

    Objective-C

    extern const PSPDFObjectFinderOption _Nonnull PSPDFObjectFinderOptionTestIntersectionFraction

    Swift

    static let testIntersectionFraction: Document.ObjectFinderOption
  • Boolean. Indicates if the content should automatically start playing.

    Declaration

    Objective-C

    extern const PSPDFGalleryOption _Nonnull PSPDFGalleryOptionAutoplay

    Swift

    static let autoplay: GalleryItem.Option
  • Boolean. Indicates if controls should be displayed.

    Declaration

    Objective-C

    extern const PSPDFGalleryOption _Nonnull PSPDFGalleryOptionControls

    Swift

    static let controls: GalleryItem.Option
  • Boolean. Indicates if the content should loop forever.

    Declaration

    Objective-C

    extern const PSPDFGalleryOption _Nonnull PSPDFGalleryOptionLoop

    Swift

    static let loop: GalleryItem.Option
  • Boolean. Indicates that the content can be presented fullscreen.

    Declaration

    Objective-C

    extern const PSPDFGalleryOption _Nonnull PSPDFGalleryOptionFullscreen

    Swift

    static let fullscreen: GalleryItem.Option
  • Key for NSNotification.userInfo dictionary.

    Where supported, the value under this key will be an instance of NSError.

    Declaration

    Objective-C

    extern NSString *const _Nonnull PSPDFInstantErrorKey

    Swift

    let PSPDFInstantErrorKey: String
  • Key for NSNotification.userInfo dictionary.

    Where supported, the value under this key will be an instance of NSString.

    Declaration

    Objective-C

    extern NSString *const _Nonnull PSPDFInstantJWTKey

    Swift

    let PSPDFInstantJWTKey: String
  • Notification posted when downloading a PDF file from the server finishes.

    The object of this notification will be the PSPDFInstantDocumentDescriptor whose download completed.

    Note

    Important: This notification will be posted on a background thread.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFInstantDidFinishDownloadNotification

    Swift

    static let PSPDFInstantDidFinishDownload: NSNotification.Name
  • Notification posted when downloading the PDF file from the server fails.

    The object of this notification will be the PSPDFInstantDocumentDescriptor whose download failed. The error that occurred (NSError) is available under PSPDFInstantErrorKey in the userInfo.

    Note

    Important: This notification will be posted on a background thread.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFInstantDidFailDownloadNotification

    Swift

    static let PSPDFInstantDidFailDownload: NSNotification.Name
  • Notification that is posted when a sync cycle begins.

    The object of this notification will be the PSPDFInstantDocumentDescriptor that started syncing. A sync cycle ends with posting either a PSPDFInstantDidFailSyncingNotification in case an error occurs, or with a PSPDFInstantDidFinishSyncingNotification when all local changes have been synced successfully.
    While the sync cycle is running, any number of PSPDFInstantSyncCycleDidChangeStateNotifications can be posted.

    For more details on the sync cycle, refer to the documentation of PSPDFInstantDocumentState.

    Note

    Important: This notification will be posted on a background thread.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFInstantDidBeginSyncingNotification

    Swift

    static let PSPDFInstantDidBeginSyncing: NSNotification.Name
  • Notification that is posted when a sync cycle changes its state.

    The object of this notification will be the PSPDFInstantDocumentDescriptor that changed its sync state. Any number of these notifications can be posted while the sync cycle is running.

    For more details on the sync cycle, refer to the documentation of PSPDFInstantDocumentState.

    Note

    Important: This notification will be posted on a background thread.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFInstantSyncCycleDidChangeStateNotification

    Swift

    static let PSPDFInstantSyncCycleDidChangeState: NSNotification.Name
  • Notification that is posted when a sync cycle completes with an error.

    The object of this notification will be the PSPDFInstantDocumentDescriptor that failed synchronization. The error that occurred (NSError) is available under PSPDFInstantErrorKey in the userInfo.

    Note

    Important: This notification will be posted on a background thread.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFInstantDidFailSyncingNotification

    Swift

    static let PSPDFInstantDidFailSyncing: NSNotification.Name
  • Notification that is posted when a sync cycle completes successfully.

    The object of this notification will be the PSPDFInstantDocumentDescriptor that has been synced.

    For more details on the sync cycle, refer to the documentation of PSPDFInstantDocumentState.

    Note

    Important: This notification will be posted on a background thread.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFInstantDidFinishSyncingNotification

    Swift

    static let PSPDFInstantDidFinishSyncing: NSNotification.Name
  • Notification posted when Instant fails to authenticate with the PSPDFKit Server to synchronize annotations.

    This notification typically means that the user no longer has access to the document or that the JWT expired. You should ask your backend server for a new JWT for this document identifier and, if the user should still be allowed to access that document, pass the new JWT into -[PSPDFInstantDocumentDescriptor reauthenticateWithJWT:]. If your backend server decided that the user no longer has access, stop showing this document to the user and call -[PSPDFInstantDocumentDescriptor removeLocalStorageWithError:] instead.

    The object of this notification will be the PSPDFInstantDocumentDescriptor that could not be authenticated.

    Note

    Important: This notification will be posted on a background thread.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFInstantDidFailAuthenticationNotification

    Swift

    static let PSPDFInstantDidFailAuthentication: NSNotification.Name
  • Notification posted when the authentication token for a document has been successfully updated.

    The object of this notification will be the PSPDFInstantDocumentDescriptor that has been reauthenticated. The accepted JWT is available as an NSString under PSPDFInstantJWTKey in the notification’s userInfo.

    Note

    Important: This notification will be posted on a background thread.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFInstantDidFinishReauthenticationNotification

    Swift

    static let PSPDFInstantDidFinishReauthentication: NSNotification.Name
  • Notification posted when the authentication token for a document could not be updated.

    The object of this notification will be the PSPDFInstantDocumentDescriptor that could not be reauthenticated. The error that occurred is available under PSPDFInstantErrorKey in the notification’s userInfo.

    Note

    Important: This notification will be posted on a background thread.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFInstantDidFailReauthenticationNotification

    Swift

    static let PSPDFInstantDidFailReauthentication: NSNotification.Name
  • Domain for errors encountered by PSPDFKit Instant.

    Declaration

    Objective-C

    extern const NSErrorDomain _Nonnull PSPDFInstantErrorDomain

    Swift

    let PSPDFInstantErrorDomain: String
  • Key for NSError userInfo for the PSPDFInstantDocumentDescriptorDescriptor an error relates to, if applicable.

    Declaration

    Objective-C

    extern NSString *const _Nonnull PSPDFInstantErrorDocumentDescriptorKey

    Swift

    let PSPDFInstantErrorDocumentDescriptorKey: String
  • Key for NSError userInfo for the PSPDFDocument an error relates to, if applicable.

    Declaration

    Objective-C

    extern NSString *const _Nonnull PSPDFInstantErrorDocumentKey

    Swift

    let PSPDFInstantErrorDocumentKey: String
  • Key for NSError userInfo for the annotation identifier an error relates to, if applicable.

    Declaration

    Objective-C

    extern NSString *const _Nonnull PSPDFInstantErrorAnnotationIdentifierKey

    Swift

    let PSPDFInstantErrorAnnotationIdentifierKey: String
  • User info key for the (extended) SQLite error code as an NSNumber in the case of PSPDFInstantErrorDatabaseAccessFailed.

    A detailed discussions of these codes can be found at https://www.sqlite.org/rescode.html

    Note

    Important: This value can very well be nil! (Not all database access errors need to be SQLite errors.)

    Declaration

    Objective-C

    extern NSString *const _Nonnull PSPDFInstantErrorSQLiteExtendedErrorCodeKey

    Swift

    let PSPDFInstantErrorSQLiteExtendedErrorCodeKey: String
  • User info key for the detailed errors in the case of PSPDFInstantErrorCouldNotPurgeDiskCacheEntries.

    The value under this key is an NSDictionary<NSString *, NSError *> *, where each key represents a document ID that could not be purged, and the corresponding value captures the reason why this failed.

    Declaration

    Objective-C

    extern NSString *const _Nonnull PSPDFInstantErrorPurgeErrorsByDocumentIDKey

    Swift

    let PSPDFInstantErrorPurgeErrorsByDocumentIDKey: String
  • User info key for the identifier of the attachment in the case of PSPDFInstantErrorAttachmentNotLoaded or PSPDFInstantErrorNoSuchAttachment.

    The value under this key is the identifier for the attachment that could not be accessed/fetched as an NSString.

    Declaration

    Objective-C

    extern NSString *const _Nonnull PSPDFInstantErrorAttachmentIDKey

    Swift

    let PSPDFInstantErrorAttachmentIDKey: String
  • The annotation that caused an error.

    Declaration

    Objective-C

    extern NSString *const _Nonnull PSPDFInstantErrorAnnotationKey

    Swift

    let PSPDFInstantErrorAnnotationKey: String
  • X-Callback URL, see http://x-callback-url.com

    Note

    This is used for the Chrome activity in PSPDFWebViewController. Example: PSPDFKitGlobal.sharedInstance[PSPDFSettingKeyXCallbackURLString] = @"pspdfcatalog://";

    Declaration

    Objective-C

    extern const PSPDFSettingKey _Nonnull PSPDFSettingKeyXCallbackURLString

    Swift

    static let xCallbackURLString: SDK.Setting
  • Custom PSPDFApplicationPolicy instance that can be configured with setLicenseKey:options:.

    Declaration

    Objective-C

    extern const PSPDFSettingKey _Nonnull PSPDFSettingKeyApplicationPolicy

    Swift

    static let applicationPolicy: SDK.Setting
  • Custom PSPDFFileManager instance that can be configured with setLicenseKey:options:.

    Declaration

    Objective-C

    extern const PSPDFSettingKey _Nonnull PSPDFSettingKeyFileManager

    Swift

    static let fileManager: SDK.Setting
  • Custom coordinated PSPDFFileManager instance that can be configured with setLicenseKey:options:.

    Declaration

    Objective-C

    extern const PSPDFSettingKey _Nonnull PSPDFSettingKeyCoordinatedFileManager

    Swift

    static let coordinatedFileManager: SDK.Setting
  • Specifies whether coordinated file operations are used by default in PSPDFDocument. Creates PSPDFCoordinatedFileDataProviders when initializing documents with local URLs. Expects a boolean NSNumber. Defaults to @YES. Set to @NO to disable.

    Declaration

    Objective-C

    extern const PSPDFSettingKey _Nonnull PSPDFSettingKeyFileCoordinationEnabled

    Swift

    static let fileCoordinationEnabled: SDK.Setting
  • Specifies the indexing priority that the shared PSPDFLibrary instance must use. Must be a valid PSPDFLibraryIndexingPriority value wrapped in a NSNumber. SeePSPDFLibraryIndexingPriority` for details.

    Declaration

    Objective-C

    extern const PSPDFSettingKey _Nonnull PSPDFSettingKeyLibraryIndexingPriority

    Swift

    static let libraryIndexingPriority: SDK.Setting
  • Enables various debug UI options. (e.g. more settings)

    Declaration

    Objective-C

    extern const PSPDFSettingKey _Nonnull PSPDFSettingKeyDebugMode

    Swift

    static let debugMode: SDK.Setting
  • Allows you to specify additional font directories. Expects an array of strings.

    Some PDFs don’t contain embedded fonts and sometimes the system fonts don’t provide a good enough replacement. In that case, you can ship your own fonts and point PSPDFKit to your additional font directories.

    Declaration

    Objective-C

    extern const PSPDFSettingKey _Nonnull PSPDFSettingKeyAdditionalFontDirectories

    Swift

    static let additionalFontDirectories: SDK.Setting
  • Specifies whether PSPDFDocument permissions are honored in the PSPDFKit UI.

    PSPDFKit will honor certain PDF permissions and prevent corresponding UI actions, such as editing annotations, if the document disallows them. This option can be used to globally disable this behavior and instead allow all configured UI actions regardless of document permissions.

    Note

    This option will affect the output of PSPDFDocument.features while PSPDFDocument.permissions will still reflect the actual values configured in the PDF document. For documents that were instantiated before changing this option, [document.features updateFeatures] needs to be invoked to ensure the changes are correctly reflected in the features system.

    Expects a boolean NSNumber. Defaults to @YES. Set to @NO to disable.

    Declaration

    Objective-C

    extern const PSPDFSettingKey _Nonnull PSPDFSettingKeyHonorDocumentPermissions

    Swift

    static let honorDocumentPermissions: SDK.Setting
  • Deprecated

    Deprecated in PSPDFKit 9.3 for iOS. Compatibility constant. Please migrate to PSPDFFeatureMaskRequireSignedSource

    Objective-C source compatibility with 9.2.x and older.

    Declaration

    Objective-C

    extern const PSPDFFeatureMask PSPDFFeatureRequireSignedSource

    Swift

    let PSPDFFeatureRequireSignedSource: Features