Annotations

  • Base class for Line, Polygon and PolyLine annotations.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAbstractLineAnnotation
        : PSPDFAbstractShapeAnnotation <PSPDFMeasurementAnnotation>

    Swift

    class AbstractLineAnnotation : AbstractShapeAnnotation, MeasurementAnnotation
  • The base class for Ink, Rectangle, Circle, Line, Polygon and PolyLine annotations.

    These annotations are created in the UI using PSPDFDrawView.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAbstractShapeAnnotation
        : PSPDFAnnotation <PSPDFMeasurementAnnotation>

    Swift

    class AbstractShapeAnnotation : Annotation, MeasurementAnnotation
  • Base class for Highlight, Underline, StrikeOut and Squiggly annotations. You should never create instances of this class directly. Use one of its subclasses instead.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFTextMarkupAnnotation : PSPDFAnnotation

    Swift

    class TextMarkupAnnotation : Annotation
  • Annotation is the base class for all PDF annotations and form elements.

    Don’t directly make an instance of this class, use subclasses like NoteAnnotation or LinkAnnotation. This class will return nil if initialized directly, unless with the type .undefined.

    AnnotationManager searches the runtime for subclasses of Annotation and builds up a dictionary using supportedTypes.

    As well as the various annotation subclasses, there are two types to model annotation types:

    • Annotation.Kind is mostly used for the type of an existing annotation. As an option set, it can be convenient to add and remote types from certain API such as the PDFConfiguration’s editableAnnotationTypes.
    • Annotation.Tool is mostly used as the type of a tool for creating annotations. As well as annotation types it includes pure tools such as .eraser. The tools are activated in the UI with AnnotationToolbar and AnnotationStateManager.

    Note

    Thread safety: Annotation objects should only ever be edited on the main thread. Modify properties on the main thread only if they are already active (for creation, it doesn’t matter which thread creates them). Before rendering, obtain a copy of the annotation to ensure it’s not mutated while properties are read. Once the documentProvider is set, modifying properties on a background thread will throw an exception.

    Annotation properties are specified in normalized PDF coordinates: they take page rotation and CropBox offset into account. Prior to PSPDFKit 8 for iOS and PSPDFKit 3 for macOS properties were specified in PDF coordinates: not taking the page rotation and offset into account. After unarchiving annotations from NSCoder archives created with older versions of PSPDFKit, the properties will be untransformed, and will be modified to apply the page transform when the annotation is added to a document.

    Annotations contain internal state once they are attached to a document. Don’t take them and add them to another document. Instead, create a new annotation and set the properties relevant for you, and add this annotation.

    For efficiency and control, you must manually notify PSPDFKit after modifying the properties of annotations. After changing any annotation properties, post an .PSPDFAnnotationChanged notification to ensure the annotation is re-rendered and the UI is updated. If you change multiple properties at once, you just need to post the notification once.

    Warning

    Annotations are mutable objects. Do not store them in NSSet or other objects that require a hash-value that does not change.
    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotation : PSPDFModel
    extension Annotation: Identifiable

    Swift

    class Annotation : ModelObject
  • The types of author-specific state that may be associated with an annotation. States are grouped into categories defined by PSPDFAnnotationAuthorStateModel. See the Annotation States section in the PDF specification.

    See more

    Declaration

    Objective-C

    enum PSPDFAnnotationAuthorState : NSUInteger {}
  • Collects annotations from the various PSPDFAnnotationProvider implementations.

    Usually you want to add your custom PSPDFAnnotationProvider instead of subclassing this class. If you subclass, use overrideClass:withClass: in Document.

    This class will set the documentProvider on both annotation adding and retrieving. You don’t have to handle this in your annotationProvider subclass.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationManager
        : NSObject <PSPDFAnnotationProviderChangeNotifier, PSPDFOverridable>

    Swift

    class AnnotationManager : NSObject, AnnotationProviderChangeNotifier, Overridable
  • With the annotation provider, you can mix in PDF annotations from any source (custom database, web, etc) Implement your custom provider class and register it in the PSPDFAnnotationManager.

    (Make sure to register the provider in the PSPDFDocument’s didCreateDocumentProvider: method, since a Document can have multiple PSPDFDocumentProviders and thus multiple PSPDFAnnotationProviders - and they can also be discarded on low memory situations.)

    Ensure everything is thread safe here - methods will be called from any threads and sometimes even concurrently at the same time. (If you’re doing parsing, block and then in the queue re-check so you’re not parsing multiple times for the same page)

    Note

    You should always use PSPDFContainerAnnotationProvider as the base class for your custom annotation provider.
    See more

    Declaration

    Objective-C

    @protocol PSPDFAnnotationProvider <NSObject>

    Swift

    protocol AnnotationProvider : NSObjectProtocol
  • An annotation set may be used to add and position multiple annotations.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationSet : PSPDFModel <NSFastEnumeration>

    Swift

    class AnnotationSet : ModelObject, NSFastEnumeration
  • Defines an annotation style.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationStyle : PSPDFModel

    Swift

    class AnnotationStyle : ModelObject
  • The annotation style manager will save UI-specific properties for annotations and apply them after creation.

    It also offers a selection of user-defined styles. There are three categories: Last used, key-specific and generic styles.

    See more

    Declaration

    Objective-C

    @protocol PSPDFAnnotationStyleManager

    Swift

    protocol AnnotationStyleManager
  • Produces a summary of the annotations in a document.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationSummarizer : NSObject

    Swift

    class AnnotationSummarizer : NSObject
  • Abstract subclass that contains an asset from a link

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAssetAnnotation : PSPDFLinkAnnotation

    Swift

    class AssetAnnotation : LinkAnnotation
  • A caret annotation (PDF 1.5) is a visual symbol that indicates the presence of text edits, and share much similarity with note (text) annotations.

    Declaration

    Objective-C

    
    @interface PSPDFCaretAnnotation : PSPDFAnnotation <PSPDFOverridable>

    Swift

    class CaretAnnotation : Annotation, Overridable
  • The PDF Circle annotations (PDF 1.3) shall display an ellipse on the page.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFCircleAnnotation
        : PSPDFAbstractShapeAnnotation <PSPDFOverridable>

    Swift

    class CircleAnnotation : AbstractShapeAnnotation, Overridable
  • Default container for annotations. It’s highly recommended that you use this class as your base class if you implement a custom annotation provider in order to leverage built-in functionality that ensures annotation changes are correctly propagated throughout the framework.

    You must use this base class to support refreshing annotations in response to an external change, like from -[PSPDFDocumentProvider setRotationOffset:forPageAtIndex:]. To put that in other words, an annotation provider must subclass this class for temporary page rotations to work correctly.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFContainerAnnotationProvider : NSObject <PSPDFAnnotationProvider>

    Swift

    class PDFContainerAnnotationProvider : NSObject, AnnotationProvider
  • Models a point used for natural drawing. Use PSPDFDrawingPointFromCGPoint to convert from a point with default intensity.

    Note

    The type encoding of this struct needs to remain consistent, because drawing point data can be serialized in NSValue objects.
    See more

    Declaration

    Objective-C

    struct {}

    Swift

    struct DrawingPoint
  • Models a point used for natural drawing. Use PSPDFDrawingPointFromCGPoint to convert from a point with default intensity.

    Note

    The type encoding of this struct needs to remain consistent, because drawing point data can be serialized in NSValue objects.
    See more

    Declaration

    Objective-C

    typedef struct PSPDFDrawingPoint PSPDFDrawingPoint
  • PDF File Attachment Annotation (see 12.5.6.15, “File attachment annotations”). A file attachment annotation (PDF 1.3) contains a reference to a file, which typically shall be embedded in the PDF file (see 7.11.4, “Embedded file streams”).

    See more

    Declaration

    Objective-C

    
    @interface PSPDFFileAnnotation : PSPDFAnnotation <PSPDFOverridable>

    Swift

    class FileAnnotation : Annotation, Overridable
  • An implementation of the PSPDFAnnotationProvider protocol that uses the PDF document as source/target to load/save annotations. You almost always want to use the PSPDFFileAnnotationProvider in your PSPDFAnnotationManager. You can also use this class inside a custom annotation provider, to parse PDF annotations once and then manage them in your custom database.

    Note

    Subclassing PSPDFFileAnnotationProvider will lead to slower PSPDFProcessor performance and is strongly discouraged. This will be blocked in future versions.
    See more

    Declaration

    Objective-C

    
    @interface PSPDFFileAnnotationProvider
        : PSPDFContainerAnnotationProvider <PSPDFOverridable>

    Swift

    class PDFFileAnnotationProvider : PDFContainerAnnotationProvider, Overridable
  • PDF FreeText Annotation.

    A free text annotation (PDF 1.3) displays text directly on the page. Unlike an ordinary text annotation (see 12.5.6.4, “Text Annotations”), a free text annotation has no open or closed state; instead of being displayed in a pop-up window, the text shall be always visible.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFFreeTextAnnotation
        : PSPDFAnnotation <PSPDFRotatable, PSPDFOverridable>

    Swift

    class FreeTextAnnotation : Annotation, Rotatable, Overridable
  • Text Highlight Annotation

    Warning

    If you programmatically create a highlight annotation, you need to both set the boundingBox AND the rects array. The rects array contains boxed variants of CGRect (NSValue).

    Declaration

    Objective-C

    
    @interface PSPDFHighlightAnnotation
        : PSPDFTextMarkupAnnotation <PSPDFOverridable>

    Swift

    class HighlightAnnotation : TextMarkupAnnotation, Overridable
  • An ink annotation for freehand drawing or writing.

    This annotation type is referred to as Drawing in the PSPDFKit UI. It allows the user to add one or more strokes on top of PDF content.

    The lines are automatically scaled when the boundingBox is changed, and the boundingBox is updated when the lines are changed to enclose the new points.

    See

    The annotation tool is activated in the UI by PSPDFAnnotationStateManager and AnnotationToolbar. The drawing interaction is handled by PSPDFDrawView. Some drawing-related behaviors can be set in the PDFConfiguration, such as with its drawCreateMode property, which controls whether a new ink annotation is created after each stroke).
    See more

    Declaration

    Objective-C

    
    @interface PSPDFInkAnnotation : PSPDFAbstractShapeAnnotation <PSPDFOverridable>

    Swift

    class InkAnnotation : AbstractShapeAnnotation, Overridable
  • Instant JSON versions

    See more

    Declaration

    Objective-C

    enum PSPDFInstantJSONVersion : NSInteger {}

    Swift

    @frozen enum InstantJSONVersion : Int, @unchecked Sendable
  • PDF Line annotation.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFLineAnnotation : PSPDFAbstractLineAnnotation <PSPDFOverridable>

    Swift

    class LineAnnotation : AbstractLineAnnotation, Overridable
  • The PSPDFLinkAnnotation represents both classic PDF page/document/web links, and more types not supported by other PDF readers (video, audio, image, etc)

    PSPDFKit will automatically figure out the type for PDF link annotations loaded from a document, based on the file type. (“mp4” belongs to .video; a YouTube-URL to .youTube, etc)

    If you create a LinkAnnotation at runtime, be sure to set the correct type and use the URL parameter for your link. boundingBox defines the frame, in PDF space coordinates.

    If you want to customize how links look in the PDF, customize LinkAnnotationView’s properties. There’s currently no mapping between color/lineWidth/etc and the properties of the view. This might change in a future release.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFLinkAnnotation : PSPDFAnnotation <PSPDFOverridable>

    Swift

    class LinkAnnotation : Annotation, Overridable
  • Annotations that have a measurement variant (ex. LineAnnotation) implement this protocol. Use isMeasurement to determine if the annotation really is a measurement.

    See more

    Declaration

    Objective-C

    @protocol PSPDFMeasurementAnnotation

    Swift

    protocol MeasurementAnnotation
  • PDF Note (Text) Annotation.

    Note

    Note annotations are rendered as fixed size; much like how Adobe Acrobat renders them. PSPDFKit will always render note annotations at a fixed size of 32x32pt. We recommend that you set the boundingBox to the same value.
    See more

    Declaration

    Objective-C

    
    @interface PSPDFNoteAnnotation : PSPDFAnnotation <PSPDFOverridable>

    Swift

    class NoteAnnotation : Annotation, Overridable
  • Polyline annotations (PDF 1.5) are similar to polygons (`PSPDFPolygonAnnotation), except that the first and last vertex are not implicitly connected.

    Note

    See PSPDFAbstractLineAnnotation for details how to use and initialize.

    Declaration

    Objective-C

    
    @interface PSPDFPolyLineAnnotation
        : PSPDFAbstractLineAnnotation <PSPDFOverridable>

    Swift

    class PolyLineAnnotation : AbstractLineAnnotation, Overridable
  • Polygon annotations (PDF 1.5) display closed polygons on the page. Such polygons may have any number of vertices connected by straight lines. Polyline annotations (PDF 1.5) are similar to polygons, except that the first and last vertex are not implicitly connected.

    Note

    See PSPDFAbstractLineAnnotation for details how to use and initialize.
    See more

    Declaration

    Objective-C

    
    @interface PSPDFPolygonAnnotation
        : PSPDFAbstractLineAnnotation <PSPDFOverridable>

    Swift

    class PolygonAnnotation : AbstractLineAnnotation, Overridable
  • Undocumented

    See more

    Declaration

    Objective-C

    
    @interface PSPDFPopupAnnotation : PSPDFAnnotation <PSPDFOverridable>

    Swift

    class PopupAnnotation : Annotation, Overridable
  • Redaction Annotation

    Used to remove content from a document.

    color can be used to change the color of the overlay text. It has no effect if there is no overlay text specified. Defaults to a red color. fillColor specifies the background color of the redaction area after is has been applied. The color is drawn on all the specified rects. Defaults to black. lineWidth can be set to change the border width of the redaction in its marked state. Defaults to 5.

    Note

    Supports redacting text, images, paths, annotations, and forms.

    Note

    Redaction annotations need to be applied, after they were created and added to a document, to remove the content beneath them. See PSPDFProcessorConfiguration or PSPDFDocumentSaveOptionApplyRedactions for further information.

    Warning

    When programmatically creating a redaction annotation, both boundingBox and rects need to be set. The rects array contains boxed variants of CGRect (NSValue).

    See more

    Declaration

    Objective-C

    
    @interface PSPDFRedactionAnnotation : PSPDFAnnotation <PSPDFOverridable>

    Swift

    class RedactionAnnotation : Annotation, Overridable
  • RichMedia annotations are defined in the ISO32000 Adobe Supplement and are the modern way of embedding video content. PSPDFKit also supports the matching RichMediaExecute action to control video state.

    Declaration

    Objective-C

    
    @interface PSPDFRichMediaAnnotation : PSPDFAssetAnnotation <PSPDFOverridable>

    Swift

    class RichMediaAnnotation : AssetAnnotation, Overridable
  • A screen annotation (PDF 1.5) specifies a region of a page upon which media clips may be played. It also serves as an object from which actions can be triggered. PSPDFKit also supports the matching Rendition Actions to control the video play state.

    Note

    iOS cannot play all video/audio formats that can be used for PDF.
    See more

    Declaration

    Objective-C

    
    @interface PSPDFScreenAnnotation : PSPDFAssetAnnotation <PSPDFOverridable>

    Swift

    class ScreenAnnotation : AssetAnnotation, Overridable
  • A sound annotation (PDF 1.2) shall analogous to a text annotation except that instead of a text note, it contains sound recorded from the iOS device’s microphone or imported from a file.

    To ensure maximum compatibility set the boundingBox for sound annotations to the same size Adobe Acrobat uses (20x15pt). PSPDFKit will always render sound annotations at a fixed size of 74x44pt, centered in the provided boundingBox.

    Note

    Make sure you configured Microphone Permissions in your app. See https://pspdfkit.com/guides/ios/getting-started/permissions/#toc_microphone-permissions for further documentation.
    See more

    Declaration

    Objective-C

    
    @interface PSPDFSoundAnnotation : PSPDFAnnotation <PSPDFOverridable>

    Swift

    class SoundAnnotation : Annotation, Overridable
  • Manages sound playback for sound annotations.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFSoundAnnotationController : NSObject

    Swift

    class SoundAnnotationController : NSObject
  • The PDF Square annotations (PDF 1.3) shall display a rectangle on the page.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFSquareAnnotation
        : PSPDFAbstractShapeAnnotation <PSPDFOverridable>

    Swift

    class SquareAnnotation : AbstractShapeAnnotation, Overridable
  • Text Squiggly Annotation

    Warning

    If you programmatically create a squiggly annotation, you need to both set the boundingBox AND the rects array. The rects array contains boxed variants of CGRect (NSValue).

    Declaration

    Objective-C

    
    @interface PSPDFSquigglyAnnotation
        : PSPDFTextMarkupAnnotation <PSPDFOverridable>

    Swift

    class SquigglyAnnotation : TextMarkupAnnotation, Overridable
  • PDF stamp annotation.

    Stamp annotations that have no image and no known stampType will render their title. title is a PSPDFKit addition that is not part of the PDF specification.

    Stamps may be rotated using the rotation property from PSPDFRotatable.

    Note

    Make sure you configured Image Permissions in your app. See https://pspdfkit.com/guides/ios/getting-started/permissions/#toc_image-permissions for further documentation.
    See more

    Declaration

    Objective-C

    
    @interface PSPDFStampAnnotation
        : PSPDFAnnotation <PSPDFRotatable, PSPDFOverridable>

    Swift

    class StampAnnotation : Annotation, Rotatable, Overridable
  • Text StrikeOut Annotation

    Warning

    If you programmatically create a strikeout annotation, you need to both set the boundingBox AND the rects array. The rects array contains boxed variants of CGRect (NSValue).

    Declaration

    Objective-C

    
    @interface PSPDFStrikeOutAnnotation
        : PSPDFTextMarkupAnnotation <PSPDFOverridable>

    Swift

    class StrikeOutAnnotation : TextMarkupAnnotation, Overridable
  • Text Underline Annotation

    Warning

    If you programmatically create an underline annotation, you need to both set the boundingBox AND the rects array. The rects array contains boxed variants of CGRect (NSValue).

    Declaration

    Objective-C

    
    @interface PSPDFUnderlineAnnotation
        : PSPDFTextMarkupAnnotation <PSPDFOverridable>

    Swift

    class UnderlineAnnotation : TextMarkupAnnotation, Overridable
  • The PDF ‘Widget’ annotation. A Widget usually is a button, much like a link annotation.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFWidgetAnnotation : PSPDFAnnotation <PSPDFOverridable>

    Swift

    class WidgetAnnotation : Annotation, Overridable
  • Advanced appearance characteristics for a widget annotation. It contains additional information for constructing the annotation’s appearance stream

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAppearanceCharacteristics : PSPDFModel <PSPDFOverridable>

    Swift

    class AppearanceCharacteristics : ModelObject, Overridable
  • Container object for storing a signature containing an ink annotation and an optional signer.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFSignatureContainer : NSObject <NSSecureCoding, PSPDFOverridable>

    Swift

    class SignatureContainer : NSObject, NSSecureCoding, Overridable
  • A instance of this protocol can be set on any PSPDFAnnotation and instead of using the PSPDFKit provided appearance stream generation methods, any PDF can be returned.

    The annotation will use the first page of the returned PDF as its appearance and this content will be embedded into the PDF.

    See more

    Declaration

    Objective-C

    @protocol PSPDFAppearanceStreamGenerating <NSObject>

    Swift

    protocol AppearanceStreamGenerating : NSObjectProtocol
  • The default appearance stream generator.

    Calls -[PSPDFAnnotation drawInContext:options:] and transforms it into an appearance stream.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFDrawingContextAppearanceStreamGenerator
        : NSObject <PSPDFAppearanceStreamGenerating>

    Swift

    class DrawingContextAppearanceStreamGenerator : NSObject, AppearanceStreamGenerating
  • An appearance stream generator that makes sure to retain the current appearance stream.

    Declaration

    Objective-C

    
    @interface PSPDFRetainExistingAppearanceStreamGenerator
        : NSObject <PSPDFAppearanceStreamGenerating>

    Swift

    class RetainExistingAppearanceStreamGenerator : NSObject, AppearanceStreamGenerating
  • An appearance stream generator that takes an URL to any PDF file and returns it as the appearance stream.

    Custom appearance streams are only intended to be used with stamp annotations to create a vector stamp. Using this class with other annotation types is not supported.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFFileAppearanceStreamGenerator
        : NSObject <PSPDFAppearanceStreamGenerating>

    Swift

    class FileAppearanceStreamGenerator : NSObject, AppearanceStreamGenerating
  • Annotations that can be rotated conform to this protocol.

    Rotation is supported by these annotation types:

    Free text annotations:

    • Rotating is supported in all saving configurations.

    Stamps:

    • Only supported by standard text stamps (Acrobat stamps) and vector stamps (stamps that make use of AppearanceStreamGenerating).
      • These stamp types can only be rotated if the PDF document embeds the annotation into the document itself. I.e. the .embedded annotation save mode or .embeddedWithExternalFileAsFallback if the file is writable.
      • Rotation is not supported if the annotations are saved to an external file using the .externalFile save mode.
      • Rotation is also not supported when using XFDF (XFDFAnnotationProvider) to save annotations.
    • Rotation is not supported for image stamps or custom text stamps.
    See more

    Declaration

    Objective-C

    @protocol PSPDFRotatable <NSObject>

    Swift

    protocol Rotatable : NSObjectProtocol
  • Protocol allowing annotation updates.

    See more

    Declaration

    Objective-C

    @protocol PSPDFAnnotationUpdate <NSObject>

    Swift

    protocol AnnotationUpdate : NSObjectProtocol
  • Property keys for annotation inspector customization.

    See

    PSPDFAnnotationStyleViewController

    See

    PSPDFConfiguration

    Declaration

    Objective-C

    typedef NSString *PSPDFAnnotationStyleKey
  • Displays information about an annotation.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationCell
        : PSPDFNonAnimatingTableViewCell <PSPDFOverridable>

    Swift

    class AnnotationCell : NonAnimatingTableViewCell, Overridable
  • A fully KVO observable stand in for actual annotation content that is loaded on demand.

    Custom annotation providers may need to resolve certain annotation types using external sources. Instant, for example, only loads image annotations separately from the document and other annotations on demand, thus giving users the quickest possible time to display and sync, without sacrificing high fidelity for high bandwidth media.

    This, however, requires a mechanism to display placeholder content for annotations whose media is not readily available. PSPDFAnnotationPlaceholder fulfills that role by offering a state machine that tracks the process towards replacing a suitable placeholder with the actual content.

    States and Allowed Transitions

    Each annotation placeholder starts in an idle state. Any PSPDFAnnotationPresenting view that implements the annotationPlaceholder property can use that object’s content to display a suitable placeholder until the actual content has become available.

    In order to provide feedback as to when the actual content will be available, it can observe the placeholder’s placeholderState, which will change to “progressing” or “failed” when the process of providing the actual content starts or has failed.

    Note

    Important: In the context of PSPDFAnnotationPlaceholder, cancellation is considered an error. It will be signaled by an NSUserCancelled error in combination with state “failed”.

    While the actual content for the placeholder instance is loaded, the object remains in state “progressing” until the process completes — which results in a transition to state “completed” — or fails — which results in a transition to state “failed”. Both of these states are final, meaning there will not be any further state transitions.

    Upon transition to state “completed”, any PSPDFAnnotationPresenting view tracking a placeholder should dispose of the object, and use its new content property instead.

    Upon transition to state “failed”, any such view should update based on the placeholder object’s error, which (in many cases) will provide a localizedRecoverySuggestion, alongside a recoveryAttempter.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationPlaceholder : NSObject

    Swift

    class AnnotationPlaceholder : NSObject
  • Annotation Set cell, displays an annotation set.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationSetCell
        : PSPDFSelectableCollectionViewCell <PSPDFOverridable>

    Swift

    class AnnotationSetCell : SelectableCollectionViewCell, Overridable
  • Shows multiple annotation sets within a table cell.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationSetsCell
        : PSPDFTableViewCell <UICollectionViewDelegate, UICollectionViewDataSource>

    Swift

    class AnnotationSetsCell : PDFTableViewCell, UICollectionViewDelegate, UICollectionViewDataSource
  • AnnotationStateManager holds the current annotation state and configures the associated PDFViewController to accept input related to the currently selected annotation state. The class also provides several convenience methods and user interface components required for annotation creation and configuration.

    Interested parties can use KVO to observe the manager’s properties.

    You should never use more than one AnnotationStateManager for any given PDFViewController. It’s recommended to use -[PSPDFViewController annotationStateManager] instead of creating your own one in order to make sure this requirement is always met.

    AnnotationStateManager is internally used by AnnotationToolbar and can be re-used for any custom annotation related user interfaces.

    Creating an annotation state manager requires either Annotations or Electronic Signatures to be enabled in your license. If you have Electronic Signatures without Annotations then the only state the manager may be put into is .signature

    Note

    Do not create this class yourself. Use the existing class that is exposed in the PSPDFViewController.
    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationStateManager
        : NSObject <PSPDFOverridable, UIPencilInteractionDelegate>

    Swift

    class AnnotationStateManager : NSObject, Overridable, UIPencilInteractionDelegate
  • Generic annotation view that listens on annotation changes.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationView : UIView <PSPDFAnnotationPresenting>

    Swift

    class AnnotationView : UIView, AnnotationPresenting
  • Conforming to this protocol indicates instances can present an annotation and react to events such as page show/hide (to pause video, for example)

    See more

    Declaration

    Objective-C

    @protocol PSPDFAnnotationPresenting <NSObject>

    Swift

    protocol AnnotationPresenting : NSObjectProtocol
  • Button that shows a selected color. Highlightable.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFColorButton : PSPDFButton <PSPDFOverridable>

    Swift

    class ColorButton : PDFButton, Overridable
  • PSPDFDrawView allows drawing or erasing on top of a PDFPageView and handles new annotation creation.

    Unless otherwise noted, boxed points need to be of type PSPDFDrawingPoint.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFDrawView
        : PSPDFContainerView <PSPDFAnnotationPresenting, PSPDFOverridable>
  • Draws a circle shape representing the user touch during erasing.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFEraseOverlay : UIView <PSPDFOverridable>

    Swift

    class EraseOverlay : UIView, Overridable
  • Generic view for form elements. Adds the form accessory view and additional keyboard support. Form views are not synced with the page to allow snappier editing.

    Declaration

    Objective-C

    
    @interface PSPDFFormElementView
        : PSPDFHostingAnnotationView <PSPDFFormInputAccessoryViewDelegate>

    Swift

    class PDFFormElementView : HostingAnnotationView, PDFFormInputAccessoryViewDelegate
  • Toolbar for Next|Previous controls for Form Elements.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFFormInputAccessoryView : UIView <PSPDFOverridable>

    Swift

    class PDFFormInputAccessoryView : UIView, Overridable
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PSPDFFormInputAccessoryViewDelegate<NSObject>
    
    - (void)doneButtonPressedOnFormInputView:(PSPDFFormInputAccessoryView *)inputView;
    - (void)previousButtonPressedOnFormInputView:(PSPDFFormInputAccessoryView *)inputView;
    - (void)nextButtonPressedOnFormInputView:(PSPDFFormInputAccessoryView *)inputView;
    - (void)clearButtonPressedOnFormInputView:(PSPDFFormInputAccessoryView *)inputView;
    
    - (BOOL)formInputViewShouldEnablePreviousButton:(PSPDFFormInputAccessoryView *)inputView;
    - (BOOL)formInputViewShouldEnableNextButton:(PSPDFFormInputAccessoryView *)inputView;
    - (BOOL)formInputViewShouldEnableClearButton:(PSPDFFormInputAccessoryView *)inputView;
    
    @end

    Swift

    protocol PDFFormInputAccessoryViewDelegate : NSObjectProtocol
  • Free Text accessory toolbar for faster styling.

    See more
  • Free Text View. Allows inline text editing.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFFreeTextAnnotationView
        : PSPDFHostingAnnotationView <UITextViewDelegate, PSPDFOverridable>

    Swift

    class FreeTextAnnotationView : HostingAnnotationView, UITextViewDelegate, Overridable
  • View that will render an annotation.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFHostingAnnotationView
        : PSPDFAnnotationView <PSPDFRenderTaskDelegate, PSPDFOverridable>

    Swift

    class HostingAnnotationView : AnnotationView, RenderTaskDelegate, Overridable
  • Base class for all link-annotation subclasses.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFLinkAnnotationBaseView : UIView <PSPDFAnnotationPresenting>

    Swift

    class LinkAnnotationBaseView : UIView, AnnotationPresenting
  • Displays an annotation link.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFLinkAnnotationView
        : PSPDFLinkAnnotationBaseView <PSPDFOverridable>

    Swift

    class LinkAnnotationView : LinkAnnotationBaseView, Overridable
  • Renders a note annotation’s icon on its page. Note annotations are handled as subviews to be draggable.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFNoteAnnotationView : PSPDFAnnotationView <PSPDFOverridable>

    Swift

    class NoteAnnotationView : AnnotationView, Overridable
  • Captures touches and shows selection boxes during dragging. Shows the selection box during dragging when using the annotation selection tool. (The rectangle between the start location of dragging and the current touch location.) With the highlight tool, this also shows the proposed text to be highlighted. With the annotation selection tool, this also shows the proposed selected annotations. The selection color is determined by the tintColor property inherited from UIView. This is also used for text block debugging.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFSelectionView : UIView <PSPDFOverridable>

    Swift

    class SelectionView : UIView, Overridable
  • Cell that is used for displaying a signature. Displays a label and an image beneath each other.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFSignatureCell : UITableViewCell <PSPDFOverridable>

    Swift

    class SignatureCell : UITableViewCell, Overridable
  • An object that stores signature annotations.

    You can implement this protocol and set the object as the PDFConfiguration’s signatureStore to use your own backend for saving and loading the user’s signatures. Read more: https://pspdfkit.com/guides/ios/signatures/signature-storage/

    The store must support NSSecureCoding because the store is part of the PDFConfiguration object. If your store requires any identifiers such as a store name or a username, ensure these are serialized and deserialized.

    If you want a simple on-device store, PSPDFKit provides KeychainSignatureStore, which implements this protocol.

    See more

    Declaration

    Objective-C

    @protocol PSPDFSignatureStore <NSObject, NSSecureCoding>

    Swift

    protocol SignatureStore : NSSecureCoding, NSObjectProtocol