Can you create digital signatures without a signature form field?

Q: Can you create digital signatures without a signature form field?

A: No, you always require a SignatureFormField for signing but it can have an empty bounding box making it invisible.

Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Create an empty rect.
val rectFSignatureFormConfiguration = RectF(
    30f, // left
    190f, // top
    30f, // right
    190f // bottom
)

val signatureFormConfiguration = SignatureFormConfiguration.Builder(0, rectFSignatureFormConfiguration)
    .build()
val signatureFormField = document.formProvider.addFormElementToPage("signaturefield-1", signatureFormConfiguration) as SignatureFormField

// Now perform your actual digitial signing with the newly created form field.
performSigning(signatureFormField)
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Create an empty rect.
RectF rectFSignatureFormConfiguration = new RectF(
    30, // left
    190, // top
    30, // right
    190 // bottom
);

SignatureFormConfiguration signatureFormConfiguration = new SignatureFormConfiguration.Builder(0, rectFSignatureFormConfiguration)
    .build();
SignatureFormField signatureFormField = (SignatureFormField) document.getFormProvider().addFormElementToPage("signaturefield-1", signatureFormConfiguration);

// Now perform your actual digitial signing with the newly created form field.
performSigning(signatureFormField);

See here on how to create digital signatures.