PTSignaturesManager

@interface PTSignaturesManager : NSObject <PTOverridable>

Creates signatures and manages saved ones.

  • Used to determine the number of saved signatures.

    Declaration

    Objective-C

    - (NSUInteger)numberOfSavedSignatures;

    Swift

    func numberOfSavedSignatures() -> UInt

    Return Value

    the number of saved signatures.

  • Gets a saved signature.

    Declaration

    Objective-C

    - (nullable PTPDFDoc *)savedSignatureAtIndex:(NSInteger)index;

    Swift

    func savedSignature(at index: Int) -> PTPDFDoc?

    Parameters

    index

    the index number of the saved signature

    Return Value

    the saved signature.

  • Returns an image of the signature at the given index of the given hight.

    Declaration

    Objective-C

    - (nullable UIImage *)imageOfSavedSignatureAtIndex:(NSInteger)index
                                                   dpi:(NSUInteger)dpi;

    Swift

    func imageOfSavedSignature(at index: Int, dpi: UInt) -> UIImage?

    Parameters

    index

    The index of the signature.

    dpi

    The DPI to render the image at. (If unsure, start with 72.)

    Return Value

    A rasterized copy of the signature.

  • Deletes the saved signature

    Declaration

    Objective-C

    - (BOOL)deleteSignatureAtIndex:(NSInteger)index;

    Swift

    func deleteSignature(at index: Int) -> Bool

    Parameters

    index

    the index of the signature to delete

    Return Value

    YES if the signature was successfully deleted; NO otherwise.

  • Reorders the signatures

    Declaration

    Objective-C

    - (BOOL)moveSignatureAtIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;

    Swift

    func moveSignature(at fromIndex: Int, to toIndex: Int) -> Bool

    Parameters

    fromIndex

    the originating index number of the signature

    toIndex

    the destination index number of the signature

    Return Value

    YES if the signature was successfully moved; NO otherwise.

  • Creates a new saved signature.

    Declaration

    Objective-C

    - (nonnull PTPDFDoc *)createSignature:(nonnull NSMutableArray *)points
                          withStrokeColor:(nonnull UIColor *)strokeColor
                      withStrokeThickness:(CGFloat)thickness
                               withinRect:(CGRect)rect
                            saveSignature:(BOOL)saveSignature;

    Swift

    func createSignature(_ points: NSMutableArray, withStroke strokeColor: UIColor, withStrokeThickness thickness: CGFloat, within rect: CGRect, saveSignature: Bool) -> PTPDFDoc

    Parameters

    points

    A set of FreeHand points.

    strokeColor

    The color of the freehand stroke.

    thickness

    The thickness of the freehand stroke.

    rect

    The bounding rect of the points.

    saveSignature

    YES if the signature shold be saved as the default signature.

    Return Value

    a PDFDoc where page 1 is the signature.