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
// Create a new signature form element.
let signatureFormElement = SignatureFormElement()
// Position it in the document.
signatureFormElement.boundingBox = CGRect(x: 100, y: 100, width: 100, height: 20)
// Add it to the first page.
signatureFormElement.pageIndex = 0

// Insert a form field for the form element.
let signatureFormField = try! SignatureFormField.insertedSignatureField(withFullyQualifiedName: "Digital Signature", documentProvider: documentProvider, formElement: signatureFormElement)

// Now perform your actual digitial signing with the newly created form field.
signFormField(signatureFormField)
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Create a new signature form element.
PSPDFSignatureFormElement *signatureFormElement = [[PSPDFSignatureFormElement alloc] init];
// Position it in the document.
signatureFormElement.boundingBox = CGRectMake(100.f, 100.f, 100.f, 20.f);
// Add it to the first page.
signatureFormElement.pageIndex = 0;

// Insert a form field for the form element.
NSError *error;
PSPDFSignatureFormField *signatureFormField = [PSPDFSignatureFormField insertedSignatureFieldWithFullyQualifiedName:@"Digital Signature" documentProvider:documentProvider formElement:signatureFormElement error:&error];
if (!signatureFormField) {
    // Handle error.
}

// Now perform your actual digitial signing with the newly created form field.
[self signFormField:signatureFormField];

See here on how to create digital signatures.