Creating the JSON model
The Microsoft Word template depends on the JSON model, so you create that first. For the tutorial, you use a basic JSON structure that contains company details, such as contact information.
{
"vendor": {
"companyName": "GlobalCorp",
"street": "123 Any Street",
"street2": "",
"city":"Anywhere",
"state":"CA",
"primaryContact": {
"firstName":"John",
"lastName":"Doe",
"email":"john-doe@example.com",
"phone":"123-456-7890"
}
},
"authorizedSigner": {
"firstName": "Sarah",
"lastName": "Rose",
"email": "sarah@example.com",
"phone":"555-555-1234"
}
}
You use this structure inside Microsoft Word to generate a template. This data can come from any data source, as long as it is in JSON format. For simplicity, you create multiple files inside the Node.js application, but your use case might require a database connection to pull vendor information.
Creating the Microsoft Word template
Create the NDA template in a Microsoft Word document. Adobe PDF Services API expects the Microsoft Word document to contain tags where the service can inject values from JSON documents. Although the template is the same for all requests to Adobe, the dynamic data in JSON changes. These tags help create PDF documents for every vendor in this case, using a single Microsoft Word template and speeding up the process by automating NDA document generation.
You can install the free Document Generation Tagger add-in to Microsoft Word. If you are a part of an organization, you can request your Microsoft Office administrator to install the free add-in for everyone.
Once you have the add-in installed, you can find it in the Home tab under the Adobe category. To open the tab, select Document Generation:
Inside the tab, you can upload the sample JSON document. This document can be a sample because you only use it to create a Microsoft Word template.
Select Generate Tags to view items you can use inside your template. Here are the properties extracted from the JSON structure, ready for use in the template:
These are the features from the authorizedSigner
field. Other fields are wrapped, and you can expand the view in Microsoft Word. The add-in offers advanced data options as well, such as tables, lists, calculated values, and more.