AutoMailMerge™ and PDF Forms "How to's"
FAQ:
  1. What types of PDF form fields can be filled by the AutoMailMerge?
  2. How to check a radio or check box.
  3. Selecting a string in a list or combo box.
  4. Filling a single PDF form field with data from multiple data fields.
  5. Change format of the data when filling a form.
  6. Filling a form field with multi-line text.
  7. Password-protecting output documents with individual passwords.
  8. Naming output PDF files using text from data fields.
  9. Emailing PDF documents to email addresses from a data source.
  10. Customizing a subject line and a message body of the emails.
  11. Adding a "mailing address" text to a document without extra blank lines and spacing.
  12. Make certain form fields "read only".
  13. Hide certain form fields in output documents.
  14. Make all fields read-only.
  15. Create a single output document with all filled forms.
  16. Delete pages from an output form based on a field value.
  17. Modify a form field based on a check box status.
  18. Create and print multiple mailing labels or business cards.
  19. Populate a form field with a current date.
  20. Clear all fields with 0 values.
  21. Prevent certain form fields from being cleared via "Reset Form" button.
  22. Change field's text color if a reader made changes to a field content.
1. What types of PDF form fields can be filled by the plug-in?
Most standard and custom PDF form fields can be filled by using AutoMailMerge plug-in. This includes text and numeric fields, radio and check boxes, combo and list boxes and etc. Use the following step-by-step tutorial to learn how to create PDF form fields in Adobe Acrobat -
2. How to check a radio or check box.
By default, radio and check boxes are selected by filling with “Yes” text string. This can be changed by modifying an “export value” of the corresponding PDF form field. Use Acrobat's form tools to select and modify form field properties. Read "Checking PDF Form Checkboxes" topic for more details.
3. Selecting a string in a list or combo box.
Every entry in the list or combo box has an associated “export value”. Export value is a text that is used to identify a particular selection. “Export” value of the selection may be the same or may be completely different from its appearance. It is up to the form designer to assign export values. Use a specific “export” value to fill a list or combo box fields. You can change field's export values by using Acrobat's form tools.
4. Filling a single PDF form field with data from multiple data fields.
Yes, you can. Multiple data source fields can be combined with any custom text to create a composite value that can be used to fill a single form field. For example, sometimes it is desirable to combine values from “City”, “State” and “ZIP” data fields into a single text string and use it to fill an address field on a form. This can be easily done by using AutoMailMerge software. You can even add your own static text to a composite field to further customize a field's content.
5. Change format of the data when filling a form.
Many PDF form fields have built-in properties that can effectively control their visual appearance. For example, a text form field can be set to display numeric, currency or date/time data in a variety of different formats. You need to edit your PDF form field and specify desired formatting as a property of each particular field. Use Acrobat's form tools to select and modify field properties.
6. Filling a form field with multi-line text.
The AutoMailMerge plug-in supports composite fields that can span one or more lines. PDF form fields need to have a "multi-line" property set to allow multi-line text in the field. Use Acrobat's form tools to select and modify field properties. See "Creating Interactive PDF Forms with Adobe Acrobat" tutorial for details.
7. Password-protecting output documents with individual passwords.
A data source field can be used to supply an individual password for each output PDF document. The plug-in will retrieve passwords from a data field and use it to password protect each output document. Any text or numeric data field can be used for this purpose. Use "Security" settings screen in AutoMailMerge settings to specify passwords.
8. Naming output PDF files using text from data fields.
It is posisble to use one or more data source fields when specifying a file naming scheme for output PDF documents. For example, you can use customer's last name and account number (assuming they are present as separate data source fields) to name output documents. Combine data fields with custom fixed text to create any desired output naming scheme.
9. Emailing PDF documents to email addresses from a data source
The plug-in can automatically email created PDF documents to recipients using email addresses stored in a data field. Add "Email" field (column) to the data file (spreadsheet) and provide an email address for each data record.
10. Customize a subject line and a message body of each email
Use data field values anywhere in the subject line and message body of the email. Insert a data field by typing a data field name surrounded by square brackets. For example, if a data source has field "FirstName", "LastName" and "Month" then you can refer to them by inserting the following text into email message template:
Dear [FirstName] [LastName],
Please find attached account statement for [Month] of [Year].

The above template will produce the following email message (sample):
Dear John Doe,
Please find attached account statement for February of 2018.
produce text lines such as "Dear John Smith" and etc.
11. Adding a "mailing address" text to a document without extra blank lines and spacing.
It is a common question for many users - how to add a neatly looking mailing address to a PDF document. The common mistake is to use separate PDF form fields for each part of the address (for example, First name, Last name, Street Address 1, Street Address 2, City, State, ZIP). This approach creates extra blank line if a "Street Address 2" field is empty. Form fields will be also separated by some excessive white space to reserve enough space for each part of the address. The solution is to use a single multiline text form field to hold all parts of the address. The plug-in provides the ability to combine multiple data source fields into a single text form field. You can combine "static" text with field values (see question #4). In addition, the software automatically remove extra blank lines that might be created if a certain data field is empty. Contact our technical support if you have any questions or need help to configure software for your particular project. 
12. Make certain form fields "read only".
1. Click "Edit Settings..." button located on the main AutoMailMerge dialog.
2. Go to a "Field Options" settings page.
3. Select fields from the list that needs to be read-only in output documents.
4. Save settings and run mail merge.

The plug-in is also able to fill-in read-only fields with data while maintaing their read-only status in output files.
13. Hide certain form fields in output documents.
1. Click "Edit Settings..." button located on the main AutoMailMerge dialog.
2. Go to a last settings page: "Select Advanced Settings".
3. Turn ON "Execute this JavaScript code AFTER filling each copy of the form" option.
4. Enter the following code for EACH form field you want to make read only (replace "Total" with actual field name from your PDF form):
var f = this.getField("Total");
f.hidden = true;
5. Save settings and run mail merge.
The following example shows how to hide a field based on its value:
var f = this.getField("Total");
if (f.value < 100)
{
   f.hidden = true;
}
The above script hides form field "Total" if its value is less than 100.
Similar scripts can be used to modify many other form field properties such as type, size, position, value, text attributes, "required" status and etc.  The plug-in also provides a special option to hide all empty text fields.
14. Make all fields read-only
Yes. Turn on "Make all form fields read-only" option that is located on "Select Output Options" application settings page.
15. Create a single output document with all filled forms.
Yes. Turn on "Output a compound document..." option that is located on "Select Output Options" application settings page.
16. Delete pages from an output form based on a field value.
Sometimes, it is necessary to check a state of a check box (checked or unchecked) and modify properties of another form field. The example below checks the state of a "Taxable" check box and sets another field ("Tax Rate") read-only if this box is checked. Please note that the check box may have any "export value" associated with it. By default, an export value is "Yes" if a check box is checked. Use field's "Properties" dialog to view or modify an actual export value for a specific check box.
var f = this.getField("Taxable");
if (f.value == "Yes")
{
   var v = this.getField("Tax Rate");
   v.readonly = true;
}
17. Modify a form field based on a check box status.
Use the following example if you need to delete pages from an output form based on a value of a certain field. The example below, deletes pages 4,5,6 if a value of field "Total" is less than 2. Please note that page numbers in the JavaScript code are always zero-based (first page in a document has a page number 0). 
var f = this.getField("Total");
if (f.value < 2)
{
     this.deletePages(3,5); // page numbers are zero based: deleting pages from 4 to 6.

18. Create and print multiple mailing labels or business cards.
It is often necessary to create and print mailing labels (business cards are another similar task) containing multiple items per sheet. This can be easily accomplished with AutoMailMerge plug-in via few simple steps:
1. Create a PDF form template that contains only 1 label on the page. Make sure a page size is set to the dimension of the label. Here is a sample PDF form.
2. Use this single-label PDF form with the AutoMailMerge plug-in. Configure the plug-in to output a single "compound" file that will contain all labels (one label per page). Turn on the option to "flatten" output documents to make them appear as regular PDF documents, not as fillable PDF forms. Here is a sample CSV data file for this example.
3. Open a compound output file that contains all labels and select "File > Print..." from the menu. Here is a sample output PDF document for the above sample CSV data file. All data in this example is fictitious.
4. In "Print" dialog set the following parameters:
- Set "Page Scaling" to "Multiple Pages Per Sheet"
- Set "Pages per Sheet" to "Custom" and specify number of labels per page (N by M).
5. Press "OK" button to start printing.

The advantage of this method is that you can print any number of labels per sheet on any paper size.
Click here to download a detailed step-by-step guide (PDF format, 125KB).
19. Populate a form field with a current date.
1. Click "Edit Settings..." button located on the main AutoMailMerge dialog.
2. Go to a last settings page: "Select Advanced Settings".
3. Turn ON "Execute this JavaScript code AFTER filling each copy of the form" option.
4. Enter the following code to populate a form field with a current date (replace "CurrentDateField" with actual field name from your PDF form):
var currentTime = new Date();
var month = currentTime.getMonth() + 1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
var f = this.getField("CurrentDateField");
f.value = (month + "/" + day + "/" + year);
5. Save settings and run mail merge.
20. Clear all fields with 0 values.
1. Click "Edit Settings..." button located on the main AutoMailMerge dialog.
2. Go to a last settings page: "Select Advanced Settings".
3. Turn ON "Execute this JavaScript code AFTER filling each copy of the form" option.
4. Enter the following code :
for (var i = 0; i < this.numFields; i++)
{
    var fname = this.getNthFieldName(i);
    var f = this.getField(fname);
    if (f.value == "0")
    {
        f.value = "";
    }
}
5. Save settings and run mail merge.
21. Prevent certain form fields from being cleared by "Reset Form" button.
There are two ways to prevent field from being cleared when a "Reset Form" button is pressed:
1. If you have control over the button that resets the fields, then simply configure it not to reset specific form fields. The user is prompted to select fields to reset when setting up the "Reset Form" action for the button. Use "Prepare Form" tool in Adobe Acrobat to edit properties of the button. Right-click on the selected button and choose "Properties..." from the popup menu. Select "Action" tab, select "Reset Form" action in the list and press "Edit..." button. Uncheck boxes in front of the fields that should not be reset.
2. If it is not possible to make changes to the "Reset Form" button, then add the following custom calculation script to all fields that need to be protected from being cleared:
event.target.defaultValue=event.value;
Note that “Reset Form” does not actually clear the form field values, it is setting them to the default values. The above script will always update the default value for the field when a new text is entered.
22. Change text color if a reader made changes to the field content.
It is necessary to add a small script to every field's Properties. The script will change text color if a field content has been modified by the reader.
1. Open a PDF form in Adobe Acrobat and select "Prepare Form" tool (the name of the form editor may be different depending on Acrobat's version).
2. Right-click on the form field and select "Properties" from the popup menu.
3. Choose "Validate" tab.
4. Select "Run custom validation script" option and press "Edit..." button.
5. Enter one of the following scripts into the editor and press OK button to finish.
The following script changes text color to red if a reader makes any modifications to the field content:
event.target.textColor = color.red;
The following script changes background color to yellow if a reader makes any modifications to the field content:
event.target.fillColor = color.yellow;
6. Close form editor and save changes to PDF form by using "File > Save" menu. 7. If you need to enables extended features for Acrobat Reader, do it after adding scripts to form fields.