PTSignaturesManager
@interface PTSignaturesManager : NSObject <PTOverridable>
Creates signatures and manages saved ones.
-
The PTSignaturesManager object’s delegate.
Declaration
Objective-C
@property (nonatomic, weak, nullable) id<PTSignaturesManagerDelegate> delegate;Swift
weak var delegate: (any PTSignaturesManagerDelegate)? { get set } -
When true, the digital signature tool allows the user to save signatures and apply previously saved signatures.
Declaration
Objective-C
@property (nonatomic) BOOL showDefaultSignature;Swift
var showDefaultSignature: Bool { get set } -
Used to determine the number of saved signatures.
Declaration
Objective-C
- (NSUInteger)numberOfSavedSignatures;Swift
func numberOfSavedSignatures() -> UIntReturn Value
the number of saved signatures.
-
The index of the last selected signature.
Declaration
Objective-C
- (NSInteger)lastSelectedSignatureIndex;Swift
func lastSelectedSignatureIndex() -> Int -
Returns the file name of the signature at the given index of the given hight.
Declaration
Objective-C
- (nullable NSString *)fileNameOfSavedSignatureAtIndex:(NSInteger)index;Swift
func fileNameOfSavedSignature(at index: Int) -> String?Parameters
indexthe index number of the saved signature
Return Value
the file name of the 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
indexThe index of the signature.
dpiThe DPI to render the image at. (If unsure, start with 72.)
Return Value
A rasterized copy of the 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 thickness:(CGFloat)thickness;Swift
func imageOfSavedSignature(at index: Int, dpi: UInt, thickness: CGFloat) -> UIImage?Parameters
indexThe index of the signature.
dpiThe DPI to render the image at. (If unsure, start with 72.)
thicknessRenders the signature with a different stroke thickness than that which it has been saved with.
Return Value
A rasterized copy of the signature.
-
Returns an image of the signature at the given index of the given hight.
Declaration
Objective-C
- (nullable UIImage *)imageOfDoc:(nullable PTPDFDoc *)doc dpi:(NSUInteger)dpi;Swift
func image(of doc: PTPDFDoc?, dpi: UInt) -> UIImage?Parameters
docThe PTPDFDoc object of the signature.
dpiThe DPI to render the image at. (If unsure, start with 72.)
Return Value
A rasterized copy of the signature.
-
Returns an image of the signature at the given index of the given hight.
Declaration
Objective-C
- (nullable UIImage *)imageOfDoc:(nullable PTPDFDoc *)doc dpi:(NSUInteger)dpi thickness:(CGFloat)thickness;Swift
func image(of doc: PTPDFDoc?, dpi: UInt, thickness: CGFloat) -> UIImage?Parameters
docThe PTPDFDoc object of the signature.
dpiThe DPI to render the image at. (If unsure, start with 72.)
thicknessRenders the signature with a different stroke thickness than that which it has been saved with.
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) -> BoolParameters
indexthe index of the signature to delete
Return Value
YESif the signature was successfully deleted;NOotherwise. -
Reorders the signatures
Declaration
Objective-C
- (BOOL)moveSignatureAtIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;Swift
func moveSignature(at fromIndex: Int, to toIndex: Int) -> BoolParameters
fromIndexthe originating index number of the signature
toIndexthe destination index number of the signature
Return Value
YESif the signature was successfully moved;NOotherwise. -
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) -> PTPDFDocParameters
pointsA set of FreeHand points.
strokeColorThe color of the freehand stroke.
thicknessThe thickness of the freehand stroke.
rectThe bounding rect of the points.
saveSignatureYESif the signature shold be saved as the default signature.Return Value
a PDFDoc where page 1 is the signature.
-
Creates a new saved signature.
Declaration
Objective-C
- (nonnull PTPDFDoc *)createSignatureWithImage:(nonnull UIImage *)image data:(nonnull NSData *)data saveSignature:(BOOL)saveSignature;Swift
func createSignature(with image: UIImage, data: Data, saveSignature: Bool) -> PTPDFDocParameters
imageThe selected image.
dataThe data of the selected image.
saveSignatureYESif the signature shold be saved as the default signature.Return Value
a PDFDoc where page 1 is the signature.
-
Creates a new saved signature.
Declaration
Objective-C
- (nonnull PTPDFDoc *)createSignatureWithText:(nonnull NSString *)text withFont:(nonnull UIFont *)font withStrokeColor:(nonnull UIColor *)strokeColor saveSignature:(BOOL)saveSignature;Swift
func createSignature(withText text: String, with font: UIFont, withStroke strokeColor: UIColor, saveSignature: Bool) -> PTPDFDocParameters
textThe input text.
fontThe font of the text.
strokeColorThe color of the text.
saveSignatureYESif the signature shold be saved as the default signature.Return Value
a PDFDoc where page 1 is the signature.
PTSignaturesManager Class Reference