Data provider

  • An implementation of PSPDFDataProviding that acts upon a file. All file access is coordinated with file coordination (NSFileCoordinator). This class implements the optional conflict resolution methods of PSPDFCoordinatedFileDataProviding.

    Declaration

    Objective-C

    
    @interface PSPDFCoordinatedFileDataProvider
        : PSPDFFileDataProvider <PSPDFCoordinatedFileDataProviding, NSFilePresenter>

    Swift

    class CoordinatedFileDataProvider : FileDataProvider, CoordinatedFileDataProviding, NSFilePresenter
  • An implementation of PSPDFDataProviding that operates on a single NSData.

    This may be used to initialize PSPDFDocument with data.

    Warning

    You might want to set a custom UID otherwise the UID will be calculated from a part of the PDF contents, which might be the same if the files are similar.

    Note

    When using this data provider, PSPDFKit is unable to automatically save annotation changes back into the PDF. Keep in mind that iOS is an environment without virtual memory. Loading a large PDF will simply get your app killed by the iOS watchdog while you try to allocate more memory than is available.

    If you use NSData because of encryption, look into PSPDFAESCryptoDataProvider or a custom implementation of PSPDFDataProviding instead for a way to dynamically decrypt the needed portions of the PDF.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFDataContainerProvider : NSObject <PSPDFDataProviding>

    Swift

    class DataContainerProvider : NSObject, DataProviding
  • Declaration

    Objective-C

    
    @interface PSPDFDataContainerSink : NSObject <PSPDFDataSink>

    Swift

    class DataContainerSink : NSObject, DataSink
  • This protocol is to be used by all possible data providers for PDF access. E.g. a FileDataProvider or AESCryptoDataProvider.

    Note

    Ensure that your implementation is thread safe. Data might be fetched from multiple threads, in random chunks.
    See more

    Declaration

    Objective-C

    @protocol PSPDFDataProviding <NSObject, NSSecureCoding>

    Swift

    protocol DataProviding : NSSecureCoding, NSObjectProtocol
  • A more specialized protocol for data providers backed by local files.

    See more

    Declaration

    Objective-C

    @protocol PSPDFFileDataProviding <PSPDFDataProviding>

    Swift

    protocol FileDataProviding : DataProviding
  • File-based data providers that support file coordination (NSFileCoordinator).

    See more

    Declaration

    Objective-C

    @protocol PSPDFCoordinatedFileDataProviding <PSPDFFileDataProviding>

    Swift

    protocol CoordinatedFileDataProviding : FileDataProviding
  • This protocol allows an implementation of PSPDFDataProviding to return an object that can be used to re-write/append to a data source.

    See more

    Declaration

    Objective-C

    @protocol PSPDFDataSink <NSObject>

    Swift

    protocol DataSink : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    
    @interface PSPDFFile : PSPDFModel

    Swift

    class File : ModelObject
  • An implementation of PSPDFDataProviding that acts upon a file.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFFileDataProvider : NSObject <PSPDFFileDataProviding>

    Swift

    class FileDataProvider : NSObject, FileDataProviding
  • A data sink backed by a file on disk

    See more

    Declaration

    Objective-C

    
    @interface PSPDFFileDataSink : NSObject <PSPDFDataSink>

    Swift

    class FileDataSink : NSObject, DataSink
  • Resolution options for conflicts due to out of process file changes or deletion.

    See more

    Declaration

    Objective-C

    enum PSPDFFileConflictResolution {}

    Swift

    enum FileConflictResolution : UInt