Annotations

  • 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 PSPDFMarkupAnnotation : PSPDFAnnotation

    Swift

    class PSPDFMarkupAnnotation : PSPDFAnnotation
  • PSPDFAnnotation is the base class for all PDF annotations and forms.

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

    PSPDFAnnotationManager searches the runtime for subclasses of PSPDFAnnotation and builds up a dictionary using supportedTypes.

    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.

    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.

    Warning

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

    Declaration

    Objective-C

    
    @interface PSPDFAnnotation : PSPDFModel <PSPDFUndoSupport, PSPDFJSONSerializing>

    Swift

    class PSPDFAnnotation : PSPDFModel, PSPDFUndoSupport, PSPDFJSONSerializing
  • 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 PSPDFDocument 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 PSPDFAnnotationProvider : NSObjectProtocol
  • An annotation set may be used to add and position multiple annotations.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationSet : PSPDFModel <NSFastEnumeration>

    Swift

    class PSPDFAnnotationSet : PSPDFModel, NSFastEnumeration
  • The 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 PSPDFAnnotationStyleManager
  • Generates an annotation summary.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFAnnotationSummarizer : NSObject

    Swift

    class PSPDFAnnotationSummarizer : NSObject
  • 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

    Swift

    class PSPDFCaretAnnotation : PSPDFAnnotation
  • 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

    Swift

    class PSPDFFreeTextAnnotation : PSPDFAnnotation
  • 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 : PSPDFMarkupAnnotation

    Swift

    class PSPDFHighlightAnnotation : PSPDFMarkupAnnotation
  • 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 PSPDFLinkAnnotationVideo; a YouTube-URL to PSPDFLinkAnnotationYouTube, etc)

    If you create a PSPDFLinkAnnotation 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 PSPDFLinkAnnotationView’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

    Swift

    class PSPDFLinkAnnotation : PSPDFAnnotation
  • 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

    Swift

    class PSPDFNoteAnnotation : PSPDFAnnotation
  • Polyline annotations (PDF 1.5) are similar to polygons (PSPDFPolygonAnnotation), except that the first and last vertex are not implicitly connected. - note: SeePSPDFAbstractLineAnnotation` for details how to use and initialize.

    Declaration

    Objective-C

    
    @interface PSPDFPolyLineAnnotation : PSPDFAbstractLineAnnotation

    Swift

    class PSPDFPolyLineAnnotation : PSPDFAbstractLineAnnotation
  • 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

    Swift

    class PSPDFRichMediaAnnotation : PSPDFAssetAnnotation
  • 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

    Swift

    class PSPDFScreenAnnotation : PSPDFAssetAnnotation
  • 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/current/getting-started/permissions/#toc_microphone-permissions for futher documentation.
    See more

    Declaration

    Objective-C

    
    @interface PSPDFSoundAnnotation : PSPDFAnnotation

    Swift

    class PSPDFSoundAnnotation : PSPDFAnnotation
  • 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 : PSPDFMarkupAnnotation

    Swift

    class PSPDFSquigglyAnnotation : PSPDFMarkupAnnotation
  • 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 : PSPDFMarkupAnnotation

    Swift

    class PSPDFStrikeOutAnnotation : PSPDFMarkupAnnotation
  • 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 : PSPDFMarkupAnnotation

    Swift

    class PSPDFUnderlineAnnotation : PSPDFMarkupAnnotation
  • 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

    Swift

    class PSPDFAppearanceCharacteristics : PSPDFModel
  • Container object for storing a siganture containing an ink annotation and an optional signer.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFSignatureContainer : NSObject <NSCoding>

    Swift

    class PSPDFSignatureContainer : NSObject, NSCoding
  • 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 PSPDFAppearanceStreamGenerating : NSObjectProtocol
  • PSPDFAnnotationStateManager holds the current annotation state and configures the associated PSPDFViewController 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 PSPDFAnnotationStateManager for any given PSPDFViewController. It’s recommended to use -[PSPDFViewController annotationStateManager] instead of creating your own one in order to make sure this requirement is always met.

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

    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>

    Swift

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

    See more

    Declaration

    Objective-C

    @protocol PSPDFAnnotationPresenting <NSObject>

    Swift

    protocol PSPDFAnnotationPresenting : NSObjectProtocol
  • PSPDFDrawView allows drawing or erasing on top of a PSPDFPageView and handles new annotation creation.

    The class holds an array of PSPDFDrawLayer objects that will later be converted into PDF annotations.

    The conversion from draw layers to annotations isn’t necessary 1:1. Some draw layers can be left out (for instance if there are validation errors like too few points for the annotation).

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

    See more

    Declaration

    Objective-C

    
    @interface PSPDFDrawView : UIView <PSPDFAnnotationPresenting, PSPDFOverridable>

    Swift

    class PSPDFDrawView : PSPDFAnnotationPresenting, PSPDFOverridable
  • Draws a circle shape representing the user touch during erasing.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFEraseOverlay : UIView

    Swift

    class PSPDFEraseOverlay : NSView
  • Toolbar for Next|Previous controls for Form Elements.

    See more

    Declaration

    Objective-C

    
    @interface PSPDFFormInputAccessoryView : UIView

    Swift

    class PSPDFFormInputAccessoryView : NSView
  • Captures touches and shows selection boxes during dragging. Shows the selection box during dragging when using the annotation selection tool. (The rectange 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

    Swift

    class PSPDFSelectionView : NSView
  • 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

    Swift

    class PSPDFSignatureCell
  • Securely stores ink signatures in the keychain. Supports NSSecureCoding since this is part of the PSPDFConfiguration object.

    See more

    Declaration

    Objective-C

    @protocol PSPDFSignatureStore <NSObject, NSSecureCoding>

    Swift

    protocol PSPDFSignatureStore : NSObjectProtocol, NSSecureCoding