Configuring the SignaturePickerFragment

The SignaturePickerFragment is shown when the user uses the ink signature tool or clicks on a signature form field. There are a couple of configuration options that affect how it behaves:

When Displayed by User Interaction

To configure the SignaturePickerFragment, you have to pass the configuration options into the PdfConfiguration:

Copy
1
2
3
4
5
val configuration = PdfActivityConfiguration.Builder(context)
    .signatureCertificateSelectionMode(SignatureCertificateSelectionMode.IF_AVAILABLE)
    .setSignaturePickerOrientation(SignaturePickerOrientation.AUTOMATIC)
    .signatureSavingStrategy(SignatureSavingStrategy.SAVE_IF_SELECTED)
    .build()
Copy
1
2
3
4
5
PdfActivityConfiguration configuration = new PdfActivityConfiguration.Builder(context)
    .signatureCertificateSelectionMode(SignatureCertificateSelectionMode.IF_AVAILABLE)
    .setSignaturePickerOrientation(SignaturePickerOrientation.AUTOMATIC)
    .signatureSavingStrategy(SignatureSavingStrategy.SAVE_IF_SELECTED)
    .build();

When Displayed Programmatically

Applying your configuration when showing the SignaturePickerFragment requires you to construct a SignatureOptions object:

Copy
1
2
3
4
5
6
val options = SignatureOptions.Builder()
    .signatureCertificateSelectionMode(SignatureCertificateSelectionMode.IF_AVAILABLE)
    .signaturePickerOrientation(SignaturePickerOrientation.AUTOMATIC)
    .signatureSavingStrategy(SignatureSavingStrategy.SAVE_IF_SELECTED)
    .build()
SignaturePickerFragment.show(supportFragmentManager, this, options)
Copy
1
2
3
4
5
6
SignatureOptions options = new SignatureOptions.Builder()
    .signatureCertificateSelectionMode(SignatureCertificateSelectionMode.IF_AVAILABLE)
    .signaturePickerOrientation(SignaturePickerOrientation.AUTOMATIC)
    .signatureSavingStrategy(SignatureSavingStrategy.SAVE_IF_SELECTED)
    .build()
SignaturePickerFragment.show(getSupportFragmentManager(), this, options);