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 ofPSPDFCoordinatedFileDataProviding
.Declaration
Objective-C
@interface PSPDFCoordinatedFileDataProvider : PSPDFFileDataProvider <PSPDFCoordinatedFileDataProviding, NSFilePresenter>
Swift
class CoordinatedFileDataProvider : FileDataProvider, CoordinatedFileDataProviding, NSFilePresenter
-
An implementation of
PSPDFDataProviding
that operates on a singleNSData
.This may be used to initialize
Document
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
See moreNSData
because of encryption, look intoPSPDFAESCryptoDataProvider
or a custom implementation ofPSPDFDataProviding
instead for a way to dynamically decrypt the needed portions of the PDF.Declaration
Objective-C
@interface PSPDFDataContainerProvider : NSObject <PSPDFDataProviding>
Swift
class DataContainerProvider : NSObject, DataProviding
-
A
See morePSPDFDataSink
that works withPSPDFDataContainerProvider
.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
orAESCryptoDataProvider
.Note
Ensure that your implementation is thread safe. Data might be fetched from multiple threads, in random chunks.Declaration
Objective-C
@protocol PSPDFDataProviding <NSObject, NSSecureCoding>
Swift
protocol DataProviding : NSSecureCoding, NSObjectProtocol
-
A more specialized protocol for data providers backed by local files.
See moreDeclaration
Objective-C
@protocol PSPDFFileDataProviding <PSPDFDataProviding>
Swift
protocol FileDataProviding : DataProviding
-
File-based data providers that support file coordination (
See moreNSFileCoordinator
).Declaration
Objective-C
@protocol PSPDFCoordinatedFileDataProviding <PSPDFFileDataProviding>
Swift
protocol CoordinatedFileDataProviding : FileDataProviding
-
This protocol allows an implementation of
See morePSPDFDataProviding
to return an object that can be used to re-write/append to a data source.Declaration
Objective-C
@protocol PSPDFDataSink <NSObject>
Swift
protocol DataSink : NSObjectProtocol
-
Undocumented
See more -
An implementation of
See morePSPDFDataProviding
that acts upon a file.Declaration
Objective-C
@interface PSPDFFileDataProvider : NSObject <PSPDFFileDataProviding>
Swift
class FileDataProvider : NSObject, FileDataProviding
-
A data sink backed by a file on disk
See moreDeclaration
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 moreDeclaration
Objective-C
enum PSPDFFileConflictResolution {}
Swift
enum FileConflictResolution : UInt