I would like to open the signature picker immediately instead of having the bottom tool with the most recent signature in it, because I have to replace this dialog with a dialog of my own for importing a custom signature from a hardware device.
Is there any way to replace the signature picker when the custom PTDigitalSignatureTool is enabled? Or is there any way to instantly trigger the signature picker dialog?
@simon.brunou Are you using the signature preset area? Or are you customizing that too? Do you mind send us an expected flow mockup so we can better suggest? Thanks.
I will eventually be customising the signature picker dialog for communicating with our device, but I would first like to display the signature picker in fullscreen when tapping the screen with the tool selected, without displaying the small signature at the bottom of the screen.
Basically, I would like to get rid of this bottom preview and trigger the signature dialog when tapping the screen.
I already implemented this functionality in Android.
However, since the library is working differently in iOS, I could not juste adapt the code in Swift and roll with it.
@simon.brunou I think there is some confusion. It looks like you reported this ticket as Android but you are actually looking to do this functionality in iOS? The screenshot shown is iOS and you mentioned “PTDigitalSignatureTool”. Is that correct?
In any case I will forward you to our iOS team, if you actually have an Android question, please kindly submit another ticket for Android. Thanks.
To hide the bottom preset area, you could subclass PTDigitalSignatureTool and return false for canEditStyle method.
We are working on a solution for you to trigger the signature dialog when tapping the screen. What is your expected behaviour for iPad? Are you customizing a fullscreen dialog for iPad too? The signature list is shown in a pop-up style on iPad in current version so it works differently from iPhone.
thank you for your answer about hiding the bottom preset area, it behaves like I want it to.
Ideally, I would like to have a full screen dialog for iPad too, but the priority is customising the signature dialog so it can wait, or I can figure it out by myself.
Hi,
the fullscreen modal behaves like expected, thank you!
Now I can get back to my original question: I would like to override the dialog shown when picking a signature. Here is an android example:
class ImprintTool(ctrl: PDFViewCtrl) : Signature(ctrl) {
companion object {
val MODE: ToolManager.ToolModeBase = ToolManager.ToolMode.addNewMode(Annot.e_Widget)
}
override fun getToolMode(): ToolManager.ToolModeBase = MODE
override fun createSignatureDialogFragment(
targetWidget: Long?,
toolManager: ToolManager?
): SignatureDialogFragment = ImprintDialogFragment()
override fun createSignatureDialogFragment(
targetWidget: Long?,
toolManager: ToolManager?,
dialogMode: SignatureDialogFragment.DialogMode?
): SignatureDialogFragment = ImprintDialogFragment()
}
The class ImprintDialogFragment extends SignatureDialogFragment.
I would like to achieve the same behaviour but in Swift. Do you know what method I should call to replace the dialog by our own dialog?
Sorry we don’t have similar methods to replace the dialog on iOS. PTSavedSignaturesViewController is a subclass of UITableViewController that shows the list of saved signatures. You might need to subclass PTSavedSignaturesViewController and customize its cells (cellForRow(at indexPath: [IndexPath])) and style by overriding methods of UITableViewController .
Since we can’t do the same as Android, is there a way to override the onTap method that you use when we click on a document?
Or a way to override the signature list that is shown when we click somewhere on a document?
I managed to override the showSignatureList of PTDigitalSignatureTool but it won’t work since i can’t change the delegate of my class that extends PTDigitalSignatureTool.
Thank you for getting back to us with more information.
Just to make sure, is this the whole flow of your expected behaviour: click somewhere on the document, the customized signature list will be presented in fullscreen, choose a signature and it signs where you click?
Do you subclass PTSavedSignaturesViewController or you want to present your own signature list in showSignatureList?
Overriding the onTap method can be achieved by subclassing PTDocumentController and implementing this method: - (BOOL)toolManager:(PTToolManager *)toolManager handleTap:(UITapGestureRecognizer *)gestureRecognizer
The flow expected is : click somewhere on the document, a custom screen is presented (not a list of signature or anything, just another view), from this view we can select a custom “signature” and it adds the “signature” where we click.
I already have a PTDigitalSignatureTool subclass where there’s apparently a showSignature method that can be override but I can’t seem to be able to make it work.
One way to achieve this functionality is to override showSignatureList, and have a callback method to add the signature after selection:
- (void)showSignatureList {
[self.toolManager.viewController presentViewController:<your customized view controller> animated:YES completion:nil];
}
- (void)yourCallbackMethodToAddSignatureDocAfterSelection:(PTPDFDoc *)theSelectedSignatureDoc {
// you could set a delegate of your customized view controller to call this method after selection
[self addStamp:theSelectedSignatureDoc];