Blog Post

Creating a PDF Form with Signature Form Fields

Illustration: Creating a PDF Form with Signature Form Fields

In this article, we outline three ways you can create a PDF form with a signature field:

  1. For web applications, you can create a PDF form with a signature field using our JavaScript PDF form library.

  2. For Web, iOS, macOS, and Android, you can create PDF forms and signature fields using our API.

  3. Lastly, you can add form and signature support using Adobe Acrobat Pro DC.

PDFs with electronic signatures are on the rise, so without further ado, let’s dive into the various ways to create a PDF form that can be signed.

PSPDFKit Form Designer

Our JavaScript PDF Library includes a PDF Form Designer, which supports dragging text and signature field elements onto documents. To see it in action, visit our form designer demo!

This example takes you through a scenario where a user can insert form fields into a document to create a lease contract, with separate signing phases for the tenant and the landlord. The Form Designer component enables an extensive set of APIs for creating and editing various PDF widget types — including text fields, checkboxes, and signatures.

The PSPDFKit Form Designer supports both Server and Standalone deployments and can become an important part of your web document workflow.

Creating and Signing PDF Forms Via the API

Form creation via the PSPDFKit PDF SDK is supported on Web, iOS, macOS, and Android. Note that PDF form creation is included in the regular Form Viewing and Filling license on iOS/macOS/Android, but it requires the Form Designer license on Web, since we have the best user experience there.

Here’s an example of how to create a signature form field in multiple languages:

// 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 third page.
signatureFormElement.pageIndex = 2

// Insert a form field for the form element.
let signatureFormField = try! SignatureFormField.insertedSignatureField(withFullyQualifiedName: "Digital Signature", documentProvider: documentProvider, formElement: signatureFormElement)
// 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 third page.
signatureFormElement.pageIndex = 2;

// 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.
}
val page = 0
val rectFSignatureFormConfiguration = RectF(
    30f, // left
    190f, // top
    200f, // right
    160f // bottom
)
val signatureFormConfiguration = SignatureFormConfiguration.Builder(page, rectFSignatureFormConfiguration)
    .build()
val signatureFormField = document.formProvider.addFormElementToPage("signaturefield-1", signatureFormConfiguration)
int page = 0;
RectF rectFSignatureFormConfiguration = new RectF(
    30, // left
    190, // top
    200, // right
    160 // bottom
);
SignatureFormConfiguration signatureFormConfiguration = new SignatureFormConfiguration.Builder(page, rectFSignatureFormConfiguration)
    .build();
SignatureFormField signatureFormField = getDocument().getFormProvider().addFormElementToPage("signaturefield-1", signatureFormConfiguration);

With the PSPDFKit API, you can add all form field types (checkboxes, radio boxes, text fields, signature fields). Programmatic form filling is also supported — even in Java and .NET.

Adobe Acrobat Professional

Adobe Acrobat Pro DC fully supports creating AcroForms. However, it’s slightly hidden. Start with the Create Form dialog: File > Create > Create Form… Then, either choose an existing form, or select Create New. Now, careful. It’s tempting to select This document requires signatures. However, this will start creating an Adobe Sign Form, which is a proprietary solution that won’t work anywhere except on Adobe’s website.

Adobe Acrobat DC Create Form Dialog

If your signature block shows a red sign arrow, you’re in the correct AcroForm mode. Otherwise, use the small down arrow next to More to Convert the form to an AcroForm.

Adobe Acrobat DC Form Toolbar

Conclusion

With the right tools, it’s easy to create AcroForms, and with PSPDFKit, you can sign them on all platforms. PSPDFKit offers the maximum level of flexibility to perfect workflows on any platform.

PSPDFKit’s PDF SDK has well-documented APIs to handle advanced use cases and ships with many out-of-the-box features:

Try our PDF library using our free trial, and check out our demos to see what’s possible.

Explore related topics

Free trial Ready to get started?
Free trial