Instant
About PSPDFKit Instant for iOS
With Instant, it’s easier than ever to add real-time collaboration features to your PSPDFKit-powered app, allowing your users to seamlessly share, edit and annotate PDF documents across iOS, Android and Web apps. Read more in the Overview guide.
At a Glance
InstantClient
: The entry point into Instant, representing a connection to your PSPDFKit Server.InstantDocumentDescriptor
: The API to each document managed by Instant. A document descriptor may be used to download the associated PDF file and create aDocument
.InstantViewController
: A subclass ofPDFViewController
that supports annotation synchronization between all users viewing the same document.InstantError.Code
: The list of Instant specific errors that can happen when managing or syncing documents.
Read more in the Usage guide.
Integration
See the Getting Started guide for a step-by-step guide to integrating Instant.
License
Instant is commercially licensed. Contact us at sales@pspdfkit.com. Copyright © 2010-2024 PSPDFKit GmbH.
Support
Feel free to submit a support ticket if you have any questions or bug reports.
-
The entry point to Instant, representing a client that can connect to PSPDFKit Server.
The Instant client manages the descriptors of the documents that you have access to. It provides the container for your downloaded documents, and controls the communication channel to the server. By providing a delegate, you are informed of relevant events regarding the synced documents and can manage tasks like authentication in a centralized manner.
See moreDeclaration
Objective-C
@interface PSPDFInstantClient : NSObject
Swift
class InstantClient : NSObject
-
The root annotation of a freely placed thread of Instant Comments.
In contrast to regular note annotation, comment markers do not have contents of their own. Instead they serve as the anchor for freely placing a comment thread on a page. The actual contents are then represented as an array of comments — objects that have no geometric or appearance-defining properties of their own.
Another difference from regular note annotations is that Instant does not support the author state model defined in the PDF standard. As a result, comment markers will always report an “unspecified” author state and ignore any corresponding updates.
See moreDeclaration
Objective-C
@interface PSPDFInstantCommentMarkerAnnotation : PSPDFNoteAnnotation
Swift
class InstantCommentMarkerAnnotation : NoteAnnotation
-
A snapshot of the disk cache entry for a certain document identifier.
Keeping these objects around after their creation does not do any harm. As snapshots, however, they do not track changes to the disk cache over time. Because the
See moreoverallDiskSpace
is typically dominated by the size of the PDF — not the annotation data stored in any layer — its order of magnitude should be fairly stable, though. Notable exceptions would be scratch-pad style documents that contain mostly empty pages, or documents with many layers containing loads of annotations each.Declaration
Objective-C
@protocol PSPDFInstantDocumentCacheEntry <NSObject>
Swift
protocol InstantDocumentCacheEntry : NSObjectProtocol
-
A
PSPDFInstantDocumentDescriptor
represents an editing context for annotations on a PDF file managed by Instant.The document descriptor allows you to download the file and synchronize the annotations in this context, while display and editing of the annotations happens via the specialized
Document
objects that it provides. You obtain instances that conform to this protocol from aPSPDFInstantClient
, which also keeps the instances it creates alive.Instant manages the PDF files on disk efficiently, and will reuse the same file for all document descriptors with the same identifier. Therefore, there are some limitations to what you can do with the
Document
instances you obtain from a document descriptor. For details, see the documentation ofeditableDocument
.Notifications
A document descriptor posts the following notifications to inform you of relevant events:
PSPDFInstantDidFailAuthenticationNotification
when authenticating the editing context failedPSPDFInstantDidFinishReauthenticationNotification
when the editing context has been reauthenticatedPSPDFInstantDidFailReauthenticationNotification
when reauthenticating the editing context failedPSPDFInstantDidFinishDownloadNotification
when the download of the PDF file and associated annotations for a docment descriptor finishesPSPDFInstantDidFailDownloadNotification
when the download of the PDF file or the associated annotations for a document descriptor failsPSPDFInstantDidBeginSyncingNotification
when the document descriptor starts a new sync cyclePSPDFInstantSyncCycleDidChangeStateNotification
when the sync cycle changes its statePSPDFInstantDidFailSyncingNotification
when the sync cycle stops abnormally (reasons include cancellation)PSPDFInstantDidFinishSyncingNotification
when the sync cycle completes successfully
Each of these notifications will typically be posted on a background thread, and have the document descriptor as their
See moreobject
property. For a centralized, more type-safe alternative seePSPDFInstantClientDelegate
, and for more details on the sync cycle, refer to the documentation ofPSPDFInstantDocumentState
.Declaration
Objective-C
@protocol PSPDFInstantDocumentDescriptor <NSObject>
Swift
protocol InstantDocumentDescriptor : NSObjectProtocol
-
A specialized variant of
PDFViewController
that supports annotation synchronization.Showing a document managed by Instant in any other view controller is not supported.
Instant on iOS doesn’t support these annotation types: caret, file, redaction, and sound. It also doesn’t support PDF forms. As such, this class sanitizes its
PDFConfiguration
to only allow supported annotation types.This view controller doesn’t support sharing/exporting documents. The
activityButtonItem
,printButtonItem
,messageButtonItem
andemailButtonItem
will automatically not be shown.If you choose to set the builder’s
See moreeditableAnnotationTypes
tonil
, all supported annotation types will be editable. If you seteditableAnnotationTypes
to an empty set, no annotations will be editable.Declaration
Objective-C
@interface PSPDFInstantViewController : PSPDFViewController
Swift
class InstantViewController : PDFViewController
-
The operations on any record-backed type supported by the currently active feature and permission set.
Missing ranges are reserved for future use.
See moreDeclaration
Objective-C
enum PSPDFInstantRecordOperations : NSUInteger {}
Swift
struct PSPDFInstantRecordOperations : OptionSet, @unchecked Sendable