Customizing the Signature Picker in Android

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:

val configuration = PdfActivityConfiguration.Builder(context)
    .signatureCertificateSelectionMode(SignatureCertificateSelectionMode.IF_AVAILABLE)
    .setSignaturePickerOrientation(SignaturePickerOrientation.AUTOMATIC)
    .signatureSavingStrategy(SignatureSavingStrategy.SAVE_IF_SELECTED)
    .build()
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:

val options = SignatureOptions.Builder()
    .signatureCertificateSelectionMode(SignatureCertificateSelectionMode.IF_AVAILABLE)
    .signaturePickerOrientation(SignaturePickerOrientation.AUTOMATIC)
    .signatureSavingStrategy(SignatureSavingStrategy.SAVE_IF_SELECTED)
    .build()
SignaturePickerFragment.show(supportFragmentManager, this, options)
SignatureOptions options = new SignatureOptions.Builder()
    .signatureCertificateSelectionMode(SignatureCertificateSelectionMode.IF_AVAILABLE)
    .signaturePickerOrientation(SignaturePickerOrientation.AUTOMATIC)
    .signatureSavingStrategy(SignatureSavingStrategy.SAVE_IF_SELECTED)
    .build()
SignaturePickerFragment.show(getSupportFragmentManager(), this, options);