How do I Customize the Options in the Annotation Inspector?

Q: How do I Customize the Options in the Annotation Inspector?

A: To customize the options in the annotation inspector you'll have to change the propertiesForAnnotations of PSPDFConfigurationBuilder with a dictionary containing a PSPDFAnnotationString specifying the annotation type as a key and the value for it should be an array of strings of the allowed properties. The below example shows how to do this specifically for an ink annotation.

Copy
1
2
3
4
5
6
7
8
9
10
11
let configuration = PSPDFConfiguration { builder in
    // Do not show color presets.
    var typesShowingColorPresets = builder.typesShowingColorPresets
    typesShowingColorPresets.remove(.ink)
    builder.typesShowingColorPresets = typesShowingColorPresets

    // Configure the properties for ink annotations to only show the color and blend mode setting in the annotation inspector.
    var properties = builder.propertiesForAnnotations
    properties[AnnotationString.ink] = [[AnnotationStyleKey.color, AnnotationStyleKey.blendMode]]
    builder.propertiesForAnnotations = properties
}

How It Will Look Like

Also be sure to check out our example AnnotationInspectorBlendModeStampExample.swift in our PSPDFCatalog example app.