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
  • 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 Document 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 Document. 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 Document 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
  • This option will reduce memory usage at the expense of performance.

    When enabled PSPDFKit will reduce memory caches and disable optimizations such as parallel document rendering. This option should be avoided, unless you’re working with extreme memory constraints.

    Note

    Set this before the framework is initialized, as part of the license key call.

    Declaration

    Objective-C

    extern const PSPDFSettingKey _Nonnull PSPDFSettingKeyLowMemoryMode

    Swift

    static let lowMemoryMode: SDK.Setting
  • Posted when the library begins indexing a document.

    The object of this notification will be the PDFLibrary instance that posts it. The UID of the document about to be indexed can be found in the userInfo under PSPDFLibraryNotificationUIDKey.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFLibraryWillStartIndexingDocumentNotification

    Swift

    static let PSPDFLibraryWillStartIndexingDocument: NSNotification.Name
  • Posted when the library completed or failed indexing a document.

    The object of this notification will be the PDFLibrary instance that posts it. The UID of the indexed document can be found in the userInfo under PSPDFLibraryNotificationUIDKey, while PSPDFLibraryNotificationSuccessKey holds a Bool, indicting whether indexing completed successfully.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFLibraryDidFinishIndexingDocumentNotification

    Swift

    static let PSPDFLibraryDidFinishIndexingDocument: NSNotification.Name
  • Posted when the library removed a document from the index.

    The object of this notification will be the PDFLibrary instance that posts it. The UID of the indexed document can be found in the userInfo under PSPDFLibraryNotificationUIDKey.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFLibraryDidRemoveDocumentNotification

    Swift

    static let PSPDFLibraryDidRemoveDocument: NSNotification.Name
  • Posted when the library did complete clearing all its indexes.

    The object of this notification will be the PDFLibrary on which clearAllIndexes() has been called. No userInfo will be provided.

    Declaration

    Objective-C

    extern const NSNotificationName _Nonnull PSPDFLibraryDidClearIndexesNotification

    Swift

    static let PSPDFLibraryDidClearIndexes: NSNotification.Name
  • In document-specific notifications posted by PDFLibrary, the userInfo key under which the UID of that document can be found.

    Declaration

    Objective-C

    extern NSString *const _Nonnull PSPDFLibraryNotificationUIDKey

    Swift

    let PSPDFLibraryNotificationUIDKey: String
  • In PSPDFLibraryDidFinishIndexingDocumentNotification, the userInfo key holding the success state of the operation as a Bool.

    Declaration

    Objective-C

    extern NSString *const _Nonnull PSPDFLibraryNotificationSuccessKey

    Swift

    let PSPDFLibraryNotificationSuccessKey: String