Basic usage

GroupDocs Signature library provides ability to manipulate with different electronic signature types such as Text, Image, Digital, Barcode, QR-code, Stamp, Form Field, Metadata. These e-signatures could be added to document, updated, deleted, verified or searched inside already signed documents. Our product also provides information about document type and structure - file type, size, pages count, etc. and generates document pages preview based on provided options.

Here are main GroupDocs Signature API concepts:

  • Signature is the main class that contains all required methods for manipulating with document e-signatures.
  • Most part of methods expects different options to eSign document, verify and search electronic signatures inside document.

Referencing required namespaces

The following code shows how to include required namespace for all code examples.

import com.groupdocs.signature;
import com.groupdocs.signature.domain;
import com.groupdocs.signature.options;
import com.groupdocs.signature.domain.extensions;

Signature object definition

The following code shows most used code pattern to define Signature object and call its methods.

// Sign document with text signature.
try
{
   Signature signature = new Signature("sample.docx")
   TextSignOptions textSignOptions = new TextSignOptions("John Smith");
   signature.sign("SampleSigned.docx", textSignOptions);
}catch (Exception e){
    throw  new GroupDocsSignatureException(e.getMessage());
}

Please check detailed examples of how to eSign documents, search and verify document signatures in the following guides: