Text Tag Extraction

Text Tag Extraction enables integrators to automatically extract signatures and fields by placing Text Tags in a document. ValidSign will analyze the uploaded document, and replace every text that matches the Text Tag pattern with the appropriate signature or field.

Text-tags usage

Text Tag Format

To add text tags you need an approved document type that already has text tags in it. These text tags must be named in a way that ValidSign can recognize. For more information, see our support page about the usage of text-tags. 

The text tags used in this topics are shown in the image below.

The signer for this document is named Signer1. This will be the custom ID used in the code to let ValidSign know what fields to associate with each signer.

Adding text-tags

The JSON below is formatted for readability. In each roles object, you will see that the custom ID is the same as shown in the image of the PDF form above The documents object also has extract set to true.

You do not have to define signature locations, nor do you have to define who needs to sign the document. This is already taken care of with the ID and the associated text tags from the PDF.

POST /api/packages

{
   "roles": [
      {
         "id": "Signer1",
         "type": "SIGNER",
         "signers": [
            {
               "email": "signer1@example.com",
               "firstName": "Firstname",
               "lastName": "Lastname",
               "id": "Signer1"
            }
         ],
         "name": "Signer1"
      }
   ],
   "documents": [
      {
         "id": "sample-contract",
         "name": "Test Document",
         "extract": true,
         "extractionTypes":[
            "TEXT_TAGS"
         ]
      }
   ],
   "status": "DRAFT",
   "type": "PACKAGE",
   "name": "Example Package"
}
DocumentPackage pkg = PackageBuilder.newPackageNamed("Example Package")
   .withStatus(PackageStatus.SENT)
      .withSigner(SignerBuilder.newSignerWithEmail("signer1@example.com")
      .withFirstName("Firstname")
      .withLastName("Lastname")
      .withCustomId("Signer1"))
   .withDocument(DocumentBuilder.newDocumentWithName("Sample Document")
      .fromFile("your_file_path")
      .withExtractionType(ExtractionType.TEXT_TAGS_ONLY)
      .enableExtraction())
   .build();
DocumentPackage pkg = PackageBuilder.NewPackageNamed("Example Package")
   .WithStatus(DocumentPackageStatus.SENT)
   .WithSigner(SignerBuilder.NewSignerWithEmail("signer1@example.com")
      .WithFirstName("Firstname")
      .WithLastName("Lastname")
      .WithCustomId("Signer1"))
   .WithDocument(DocumentBuilder.NewDocumentNamed("Sample Document")
      .FromFile("your_file_path")
      .WithExtractionType(ExtractionType.TEXT_TAGS_ONLY)
      .EnableExtraction())
   .Build();