Data provider

  • 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 PSPDFDataContainerProvider : NSObject, PSPDFDataProviding
  • This protocol is to be used by all possible data providers for PDF access. E.g. a PSPDFFileDataProvider or PSPDFAESCryptoDataProvider.

    Note

    This replaces the CGDataProvider support in earlier versions of the SDK.
    See more

    Declaration

    Objective-C

    @protocol PSPDFDataProviding <NSObject, NSSecureCoding>

    Swift

    protocol PSPDFDataProviding : NSObjectProtocol, NSSecureCoding
  • 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 PSPDFDataSink : NSObjectProtocol