Type Definitions

The following type definitions are available globally.

  • Undocumented

    Declaration

    Objective-C

    typedef NSString *PSPDFActionOption

    Swift

    struct Option : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Available annotation types. Set in editableAnnotationTypes of PSPDFConfiguration.

    Declaration

    Objective-C

    typedef NSString *PSPDFAnnotationString

    Swift

    struct Tool : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Available variants for annotations.

    Declaration

    Objective-C

    typedef NSString *PSPDFAnnotationVariantString

    Swift

    struct Variant : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Unique identifier for different annotation types. Amalgamation of annotation type and its variant. Use PSPDFAnnotationToolVariantIDMake to generate an identifier in Objective-C. Use Annotation.ToolVariantID(tool:variant:) to generate an identifer in Swift.

    Declaration

    Objective-C

    typedef NSString *PSPDFAnnotationStateVariantID

    Swift

    struct ToolVariantID : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Returns a template image (UIImageRenderingModeAlwaysTemplate).

    See

    itemWithType:variant:configurationBlock:

    Declaration

    Objective-C

    typedef NSImage *_Nonnull (^PSPDFAnnotationGroupItemConfigurationBlock)(
        PSPDFAnnotationGroupItem *_Nonnull, id _Nullable, NSColor *_Nonnull)

    Parameters

    item

    The annotation group item.

    container

    The containing PSPDFAnnotationToolbar.

    tintColor

    The tint color applied to the image.

    Return Value

    The custom image.

  • Additional behaviors when creating, changing, or deleting annotations.

    These constants will primarily be used as keys in the userInfo dictionary of annotation specific notifications.

    Declaration

    Objective-C

    typedef NSString *PSPDFAnnotationOption
  • Property keys for annotation inspector customization.

    See

    PSPDFAnnotationStyleViewController

    See

    PSPDFConfiguration

    Declaration

    Objective-C

    typedef NSString *PSPDFAnnotationStyleKey
  • A list of annotation style keys (inner array) grouped into serval groups (outer array).

    Declaration

    Objective-C

    typedef NSArray<NSArray<PSPDFAnnotationStyleKey> *>
        *PSPDFAnnotationStyleKeyGroupedList

    Swift

    typealias PSPDFAnnotationStyleKeyGroupedList = NSArray
  • A block type that takes an annotation and returns the grouped list of style keys for that particular annotation.

    Declaration

    Objective-C

    typedef PSPDFAnnotationStyleKeyGroupedList _Nonnull (
        ^PSPDFAnnotationStyleBlock)(PSPDFAnnotation *_Nonnull)

    Swift

    typealias PSPDFAnnotationStyleBlock = (PSPDFAnnotation) -> [[String]]
  • Undocumented

    Declaration

    Objective-C

    typedef NSString *PSPDFAnnotationStyleType

    Swift

    struct Kind : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Undocumented

    Declaration

    Objective-C

    typedef NSString *PSPDFAppearanceStreamGenerationOption

    Swift

    struct AppearanceStreamGenerationOption : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Available policy events.

    Declaration

    Objective-C

    typedef NSString *PSPDFPolicyEvent

    Swift

    struct PolicyEvent : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Undocumented

    Declaration

    Objective-C

    typedef void (^PSPDFCacheDocumentImageRenderingCompletionBlock)(UIImage *image, PSPDFDocument *document, PSPDFPageIndex page, CGSize size)

    Swift

    typealias PSPDFCacheDocumentImageRenderingCompletionBlock = (NSImage, PSPDFDocument, PageIndex, CGSize) -> Void
  • Undocumented

    Declaration

    Objective-C

    typedef NSString *PSPDFObjectFinderOption

    Swift

    struct ObjectFinderOption : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Undocumented

    Declaration

    Objective-C

    typedef NSString *PSPDFObjectFinderType

    Swift

    struct ObjectFinderType : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Document page number.

    Declaration

    Objective-C

    typedef NSNumber *PSPDFDocumentPageNumber

    Swift

    typealias PSPDFDocumentPageNumber = NSNumber
  • When saving a document, you can provide various save options as outlined below.

    Declaration

    Objective-C

    typedef NSString *PSPDFDocumentSaveOption

    Swift

    struct PDFDocumentSaveOption : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Undocumented

    Declaration

    Objective-C

    typedef NSString *PSPDFDocumentUnderlyingFileChangedNotificationOptions

    Swift

    struct UnderlyingFileChangedNotificationOption : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Annotation write options.

    Declaration

    Objective-C

    typedef NSString *PSPDFAnnotationWriteOption

    Swift

    struct AnnotationWriteOption : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Undocumented

    Declaration

    Objective-C

    typedef void (^PSPDFDocumentEditorSuccessBlock)(BOOL success, NSError *_Nullable error)

    Swift

    typealias PSPDFDocumentEditorSuccessBlock = (Bool, Error?) -> Void
  • Undocumented

    Declaration

    Objective-C

    typedef void (^PSPDFDocumentEditorSaveBlock)(PSPDFDocument *_Nullable document, NSError *_Nullable error)

    Swift

    typealias PSPDFDocumentEditorSaveBlock = (Document?, Error?) -> Void
  • Undocumented

    Declaration

    Objective-C

    typedef void (^PSPDFDocumentEditorImportBlock)(NSArray<PSPDFEditingChange *> * _Nullable changes, NSError *_Nullable error)

    Swift

    typealias PSPDFDocumentEditorImportBlock = ([PDFEditingChange]?, Error?) -> Void
  • Undocumented

    Declaration

    Objective-C

    typedef SEL PSPDFDocumentFeature

    Swift

    typealias PSPDFDocumentFeature = Selector
  • Undocumented

    Declaration

    Objective-C

    typedef void (^PSPDFDocumentSignDataCompletionBlock)(BOOL status, NSData * _Nullable signedData)

    Swift

    typealias PSPDFDocumentSignDataCompletionBlock = (Bool, Data?) -> Void
  • Undocumented

    See more

    Declaration

    Objective-C

    typedef struct PSPDFDrawingPoint PSPDFDrawingPoint
  • Undocumented

    Declaration

    Objective-C

    typedef unsigned long PSPDFPageIndex

    Swift

    typealias PageIndex = UInt
  • Undocumented

    Declaration

    Objective-C

    typedef unsigned long PSPDFPageCount

    Swift

    typealias PageCount = UInt
  • Undocumented

    Declaration

    Objective-C

    typedef unsigned long PSPDFFileIndex

    Swift

    typealias FileIndex = UInt
  • Defines how the attachment looks. Supported are PushPin, Paperclip, Graph and Tag.

    Declaration

    Objective-C

    typedef NSString *PSPDFFileIconName

    Swift

    struct IconName : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Undocumented

    Declaration

    Objective-C

    typedef NSString *PSPDFFileManagerOption

    Swift

    struct Option : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Undocumented

    Declaration

    Objective-C

    typedef NSString *PSPDFSettingKey

    Swift

    struct Setting : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Available options which can be used while searching text using the PDFLibrary.

    Declaration

    Objective-C

    typedef NSString *PSPDFLibraryOption

    Swift

    struct Option : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • A block that is called for each candidate for indexing found when traversing the specified directory.

    Declaration

    Objective-C

    typedef BOOL (^PSPDFLibraryFileSystemDataSourceDocumentHandler)(
        PSPDFDocument *_Nonnull, BOOL *_Nonnull)

    Swift

    typealias PSPDFLibraryFileSystemDataSourceDocumentHandler = (PSPDFDocument, UnsafeMutablePointer<ObjCBool>) -> Bool

    Parameters

    document

    The candidate document.

    stop

    A pointer to a Boolean value. The block can set the value to YES to stop further enumeration of the directory. If a block stops further enumeration, that block continues to run until it’s finished. The stop argument is an out-only argument. You should only ever set this Boolean to YES within the block.

    Return Value

    A Boolean value that indicates whether document should be indexed or not.

  • Common PDF metadata keys.

    Declaration

    Objective-C

    typedef NSString *PSPDFMetadataName
  • Undocumented

    Declaration

    Objective-C

    typedef NSString *PSPDFTemplateIdentifier

    Swift

    struct Identifier : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • 1st argument: current page, 2nd argument: total pages

    Declaration

    Objective-C

    typedef void (^PSPDFProgressBlock)(NSUInteger, NSUInteger)

    Swift

    typealias PSPDFProgressBlock = (UInt, UInt) -> Void
  • Undocumented

    Declaration

    Objective-C

    typedef void (^PSPDFRemoteContentObjectAuthenticationBlock)(NSURLAuthenticationChallenge *, void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))

    Swift

    typealias PSPDFRemoteContentObjectAuthenticationBlock = (URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential) -> Void) -> Void
  • Undocumented

    Declaration

    Objective-C

    typedef _Nullable id (^PSPDFRemoteContentObjectTransformerBlock)(NSURL *location)

    Swift

    typealias PSPDFRemoteContentObjectTransformerBlock = (URL) -> Any?
  • A block passed to PSPDFKit to render additional content or graphics on a page. Set it on -[PSPDFRenderOptions drawBlock].

    Declaration

    Objective-C

    typedef void (^PSPDFRenderDrawBlock)(CGContextRef _Nonnull, PSPDFPageIndex,
                                         CGRect, PSPDFRenderOptions *_Nonnull)

    Swift

    typealias PSPDFRenderDrawBlock = (CGContext, PageIndex, CGRect, RenderOptions) -> Void

    Parameters

    context

    The graphics context that should be drawn into.

    pageIndex

    The index of the page being drawn.

    pageRect

    A rectange the size of the page being drawn, with zero origin.

    options

    The PSPDFRenderOptions object that this block was attached to. For reference purposes only.

  • Deprecated

    Deprecated in PSPDFKit 4.4 for macOS. Renamed. Use PSPDFSignerErrorCode instead.

    Renamed. Use PSPDFSignerErrorCode instead.

    Declaration

    Objective-C

    typedef PSPDFSignerErrorCode PSPDFSignerError

    Swift

    typealias PSPDFSignerError = PDFSignerError.Code
  • Completion block for the production of documents by a PSPDFSigner instance.

    Declaration

    Objective-C

    typedef void (^PSPDFSignatureCreationBlock)(BOOL, id<PSPDFDataSink> _Nullable,
                                                NSError *_Nullable)

    Swift

    typealias PSPDFSignatureCreationBlock = (Bool, DataSink?, Error?) -> Void

    Parameters

    success

    Indicates whether the PSPDFSigner operation finished successfully or not.

    document

    Instance of a PSPDFDataSink that contains the document produced by the PSPDFSigner operation.

    error

    Indicates why the PSPDFSigner operation didn’t finish successfully, in case success returned NO.

  • List of available encodings. Used in PSPDFSoundAnnotation.encoding.

    Declaration

    Objective-C

    typedef NSString *PSPDFSoundAnnotationEncoding

    Swift

    struct Encoding : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Predefined standard values for a stamp annotation’s stampType, which will be written as Name in the PDF.

    Declaration

    Objective-C

    typedef NSString *PSPDFStampType

    Swift

    struct Kind : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • Value transformer name.

    Declaration

    Objective-C

    typedef NSString *PSPDFValueTransformerName

    Swift

    struct ValueTransformerName : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable