Other Protocols

The following protocols are available globally.

  • Trait for the types that can be found in the fields property of form actions.

    Declaration

    Objective-C

    @protocol PSPDFFormFieldIdentifier <NSObject>

    Swift

    protocol PSPDFFormFieldIdentifier : NSObjectProtocol
  • To be notified on any changes PSPDFKit does on your annotations, implement this notifier. It will be set as soon as your class is added to the annotationManager.

    See more

    Declaration

    Objective-C

    @protocol PSPDFAnnotationProviderChangeNotifier <NSObject>

    Swift

    protocol AnnotationProviderChangeNotifier : NSObjectProtocol
  • Delegate for callbacks related to annotation saving.

    See more

    Declaration

    Objective-C

    @protocol PSPDFAnnotationProviderDelegate <NSObject>

    Swift

    protocol AnnotationProviderDelegate : NSObjectProtocol
  • Deprecated

    Deprecated in PSPDFKit 4.1 for macOS. PSPDFKit now handles refreshing internally via PSPDFContainerAnnotationProvider.

    Protocol to be implemented by any annotation provider that allows refreshing of its annotations in response to an external change, like from -[PSPDFDocumentProvider setRotationOffset:forPageAtIndex:]. To put that in other words, an annotation provider must implement this protocol for temporary page rotations to work correctly.

    However, this protocol is deprecated because it is very hard to implement correctly. PSPDFContainerAnnotationProvider conforms to this protocol, which means that PSPDFKit can handle refreshing annotations internally. In a future release, this protocol will be removed, and PSPDFContainerAnnotationProvider will continue to implement refreshing internally.

    See more

    Declaration

    Objective-C

    @protocol PSPDFAnnotationProviderRefreshing <PSPDFAnnotationProvider>

    Swift

    protocol PSPDFAnnotationProviderRefreshing : AnnotationProvider
  • Protocol adopted by PSPDFColorPreset and PSPDFBorderStylePreset.

    Declaration

    Objective-C

    @protocol PSPDFStylePreset <NSObject, NSSecureCoding>

    Swift

    protocol PSPDFStylePreset : NSSecureCoding, NSObjectProtocol
  • An object to handle events from a BackForwardActionList.

    Implementing one of each of the requestedBackActionExecution and requestedForwardActionExecution methods is required. They are marked optional during the deprecation transitional period.

    See more

    Declaration

    Objective-C

    @protocol PSPDFBackForwardActionListDelegate <NSObject>

    Swift

    protocol BackForwardActionListDelegate : NSObjectProtocol
  • Methods that need to be implemented by the coordinationDelegate of a coordinated file data provider. As such, all methods in this protocol are required.

    See more

    Declaration

    Objective-C

    @protocol PSPDFFileCoordinationDelegate <NSObject>

    Swift

    protocol FileCoordinationDelegate : NSObjectProtocol
  • Delegate that can be implemented to be notified of changes that the document editor performs.

    See more

    Declaration

    Objective-C

    @protocol PSPDFDocumentEditorDelegate <NSObject>

    Swift

    protocol PDFDocumentEditorDelegate : NSObjectProtocol
  • Implemented in classes that use or modify the document editor configuration.

    See

    e.g. PSPDFNewPageViewController
    See more

    Declaration

    Objective-C

    @protocol PSPDFDocumentEditorConfigurationConfigurable <NSObject>

    Swift

    protocol PDFDocumentEditorConfigurationConfigurable : NSObjectProtocol
  • A document feature source can disable various features if there are reasons within its controlled scope that make this feature unavailable.

    You can implement your own sources by conforming to this protocol. Besides the required methods you should only implement the features that your source actually control. The result of your source will be combined with the results of the framework’s sources through a logical AND. This means if your source disallows a feature this feature is no longer available, however if your source allows a feature there might still be other sources disallowing a feature. Only if all sources allow a feature, the feature will be enabled.

    Caching

    The results of all features you implement will be cached. Whenever the state of a feature changes, you need to call [features updateFeatures] for changes to take effect. This is also necessary to allow notifying interested observers about the change in state.

    Threading

    Your custom sources have to be thread safe. They are not guaranteed to be called on any particular queue.

    See more

    Declaration

    Objective-C

    @protocol PSPDFDocumentFeaturesSource <NSObject>

    Swift

    protocol PDFDocumentFeaturesSource : NSObjectProtocol
  • An observer will be returned to you when you start observing a feature for state changes. You can either keep the observer around for removing it later on or you can bind it to the lifetime of another class which will then remove the observer automatically when the other object gets deallocated.

    See more

    Declaration

    Objective-C

    @protocol PSPDFDocumentFeaturesObserver <NSObject>

    Swift

    protocol PDFDocumentFeaturesObserver : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PSPDFDownloadManagerDelegate<NSObject>
    
    @optional
    
    /// If the delegate wants to handle authentication challenges.
    - (void)downloadManager:(PSPDFDownloadManager *)downloadManager authenticationChallenge:(NSURLAuthenticationChallenge *)authenticationChallenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler;
    
    /// Informs the delegate that the state of the given object has changed.
    ///
    /// @param downloadManager The download manager.
    /// @param object The changed object.
    - (void)downloadManager:(PSPDFDownloadManager *)downloadManager didChangeObject:(id<PSPDFRemoteContentObject>)object;
    
    /// Informs the delegate that the reachability has changed.
    ///
    /// @param downloadManager The download manager.
    /// @param reachability The new reachability.
    - (void)downloadManager:(PSPDFDownloadManager *)downloadManager reachabilityDidChange:(PSPDFReachability)reachability;
    
    @end

    Swift

    protocol DownloadManagerDelegate : NSObjectProtocol
  • The PSPDFExternalSignature protocol is adopted by an object that provides an external signature for a PDF document. You set the externalSignatureDelegate property in a PSPDFSigner class or subclass when you want to control the digital signing process with an external signature (for example, a signature that is implemented by a hardware device or by an external webservice).

    See more

    Declaration

    Objective-C

    @protocol PSPDFExternalSignature <NSObject>

    Swift

    protocol ExternalSignature : NSObjectProtocol
  • The PSPDFLibraryDataSource protocol is adopted by an object that provides the documents to be indexed by a PSPDFLibrary. These methods will not be called on the main queue, and can take long to execute. If you are implementing this protocol yourself and not using PSPDFLibraryFileSystemDataSource, please read the documentation carefully.

    See more

    Declaration

    Objective-C

    @protocol PSPDFLibraryDataSource <NSObject>

    Swift

    protocol LibraryDataSource : NSObjectProtocol
  • This protocol defines a method to override the document that the PSPDFLibraryFileSystemDataSource vends to the PSPDFLibrary.

    See more

    Declaration

    Objective-C

    @protocol PSPDFLibraryFileSystemDataSourceDocumentProvider <NSObject>

    Swift

    protocol LibraryFileSystemDataSourceDocumentProvider : NSObjectProtocol
  • Implement this delegate to get rendered pages. (Most of the times, you want to use PSPDFCache instead)

    See more

    Declaration

    Objective-C

    @protocol PSPDFRenderTaskDelegate <NSObject>

    Swift

    protocol RenderTaskDelegate : NSObjectProtocol
  • Search status delegate. All delegates are guaranteed to be called within the main thread.

    See more

    Declaration

    Objective-C

    @protocol PSPDFTextSearchDelegate <NSObject>

    Swift

    protocol TextSearchDelegate : NSObjectProtocol