PTToolManager

@interface PTToolManager
    : UIView <PTPDFViewCtrlToolDelegate, PTToolEvents, PTToolOptionsDelegate>

The PTToolManager class is responsbile for forwarding events from the PDFViewCtrl to Tools, and coordinating the control and data flow between tools.

  • The current tool.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) PTTool *tool;

    Swift

    var tool: PTTool? { get set }
  • An object that conforms to the PTToolManagerDelegate protocol.

    Declaration

    Objective-C

    @property (readwrite, nonatomic, nullable) id<PTToolManagerDelegate> delegate;

    Swift

    weak var delegate: PTToolManagerDelegate? { get set }
  • The PTPDFViewCtrl that the PTToolManager was initialized with.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PTPDFViewCtrl *_Nullable pdfViewCtrl;

    Swift

    weak var pdfViewCtrl: PTPDFViewCtrl? { get }
  • Returns a newly initialized tool manager with the required pointer to the PTPDFViewCtrl on which it will operate.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPDFViewCtrl:
        (nonnull PTPDFViewCtrl *)pdfViewCtrl;

    Swift

    init(pdfViewCtrl: PTPDFViewCtrl)

    Parameters

    pdfViewCtrl

    a pointer to the PTPDFViewCtrl that the tool manager will operate.

    Return Value

    A newly initialized tool manager object.

  • Create and set a new tool of the given type as the current tool.

    Declaration

    Objective-C

    - (nonnull PTTool *)changeTool:(nonnull Class)toolType;

    Swift

    func changeTool(_ toolType: AnyClass) -> PTTool
  • Selects the specified annotation.

    Declaration

    Objective-C

    - (BOOL)selectAnnotation:(nonnull PTAnnot *)annotation
                onPageNumber:(unsigned long)pageNumber;

    Swift

    func selectAnnotation(_ annotation: PTAnnot, onPageNumber pageNumber: UInt) -> Bool

    Parameters

    annotation

    the annotation to selected

    pageNumber

    the page number of the annotation

    Return Value

    YES if the annotation was selected, NO otherwise.

  • A string that will be used to set the author field of annotations that are created.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *annotationAuthor;

    Swift

    var annotationAuthor: String? { get set }
  • When true, the UIMenuController shows after a tap (in addition to after a long press). The default value of this property is false.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL showMenuOnTap;

    Swift

    var showMenuOnTap: Bool { get set }
  • When true, the digital signature tool gives the option to save a default signature. The default value of this property is true.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL showDefaultSignature;

    Swift

    var showDefaultSignature: Bool { get set }
  • Whether the built-in page number indicator is enabled. The default value of this property is false.

    Declaration

    Objective-C

    @property (getter=isPageIndicatorEnabled, assign, readwrite, nonatomic)
        BOOL pageIndicatorEnabled;

    Swift

    var isPageIndicatorEnabled: Bool { get set }
  • Whether the document associated with the PTPDFViewCtrl is read-only. The default value is NO.

    When in read-only mode, annotation creation and editing are disabled as well as other actions that would modify the document.

    Declaration

    Objective-C

    @property (getter=isReadonly, assign, readwrite, nonatomic) BOOL readonly;

    Swift

    var isReadonly: Bool { get set }
  • Returns whether the specified annotation allows editing.

    Declaration

    Objective-C

    - (BOOL)hasEditPermissionForAnnot:(nonnull PTAnnot *)annot;

    Swift

    func hasEditPermission(for annot: PTAnnot) -> Bool
  • Whether the permissions of an PTAnnot, returned via -[PTAnnot GetFlag:], are checked when determining whether the annotation can be edited. The default value of this property is NO.

    Declaration

    Objective-C

    @property (getter=isAnnotationPermissionCheckEnabled, assign, readwrite,
              nonatomic) BOOL annotationPermissionCheckEnabled;

    Swift

    var isAnnotationPermissionCheckEnabled: Bool { get set }
  • A boolean value that determines whether text selection is enabled.

    Declaration

    Objective-C

    @property (getter=isTextSelectionEnabled, assign, readwrite, nonatomic)
        BOOL textSelectionEnabled;

    Swift

    var isTextSelectionEnabled: Bool { get set }
  • A boolean value that determines whether form filling is enabled.

    Declaration

    Objective-C

    @property (getter=isFormFillingEnabled, assign, readwrite, nonatomic)
        BOOL formFillingEnabled;

    Swift

    var isFormFillingEnabled: Bool { get set }
  • A boolean value that determines whether link following is enabled.

    Declaration

    Objective-C

    @property (getter=isLinkFollowingEnabled, assign, readwrite, nonatomic)
        BOOL linkFollowingEnabled;

    Swift

    var isLinkFollowingEnabled: Bool { get set }
  • A boolean value that determines whether the eraser tool is enabled.

    Declaration

    Objective-C

    @property (getter=isEraserEnabled, assign, readwrite, nonatomic)
        BOOL eraserEnabled;

    Swift

    var isEraserEnabled: Bool { get set }
  • A boolean value that determines whether free text annots should get automatically resized.

    Declaration

    Objective-C

    @property (getter=isAutoResizeFreeTextEnabled, assign, readwrite, nonatomic)
        BOOL autoResizeFreeTextEnabled;

    Swift

    var isAutoResizeFreeTextEnabled: Bool { get set }