Populating Multi-line Address Fields in PDF Forms
Introduction
One of the most common mail merge tasks is adding mailing addresses to mail correspondence, such as newsletters or brochures etc. It may be necessary to fill PDF form fields with addresses over multiple lines. This tutorial explains how to add personalized mailing addresses from a customer database or spreadsheet to your correspondence, by populating multi-line form fields with data values from a sample Excel spreadsheet. Using composite fields is an effective way to combine values from multiple data fields to create a unique field value.
This is demonstrated by placing an interactive form field in a specific page location where addresses must be placed. We then execute a mail merge using the AutoMailMerge™ plug-in, creating a custom composite field mapping to insert data from a spreadsheet source.
sample filled field
Input Document Description
In the steps below, we use a sample letter to create an input PDF form. The first step is to add a 'multi-line' text field occupying a large space. We will then use a sample Excel Worksheet to transfer values from multiple data fields into this form field. The goal is to create multiple output letters that contain unique addresses for each letter recipient.
input/output data
Prerequisites
You need a copy of Adobe® Acrobat® along with the AutoMailMerge™ plug-in installed on your computer in order to use this tutorial. Both are available as trial versions.
Step 1 - Insert a Text Field
Open the PDF that you want to add a form field to in Acrobat. In this example, we are using a sample letter with an available space for addresses to be inserted. Click here to see a separate tutorial containing more detailed help with creating interactive PDF forms.
Now open the "Tools" panel located on the main Acrobat toolbar.
open tools panel
Find and click on the "Prepare Form" tool icon.
open form editor
Press the "Add a Text Field Icon"
add text field
Click and drag the cursor to draw a box where the text field should be placed on the page. Make sure that it is large enough to hold 4-5 lines of text.
draw field box
Step 2 - Edit Form Field Properties
Double-click on the form field, or right-click on it and press "Properties" to open the "Text Field Properties" dialog.
open field properties
Optionally rename the field under the "General" tab. Here, we have named it "Address". Next, open the "Appearance" tab.
rename form field
Use the "Font Size" and "Font" drop-down menus to customize the appearance of output addresses. Ensure that the font size is large enough to fill the text field. Optionally use the "Auto" option under "Font Size" to automatically fill the form field using an appropriate size.
Next, open the "Options" tab.
edit text size
Check the “Multi-line” option to allow this field to hold multiple lines of text. Press "Close" to close the dialog and save changes.
rename form field
Step 3 - Save the Form
Save changes to the PDF via the "Save" button or the "File > Save As..." menu in Acrobat.
save the PDF
Press "Close" to exit the tool.
close the tool
Step 4 - Open the "Mail Merge" Dialog
Select "Plug-Ins > Mail Merge…" to open the "Mail Merge" dialog.
open AutoMailMerge
Step 5 - Edit Mail Merge Settings
Clear current settings (if necessary), then press the "Edit Settings…" button.
edit merge settings
Press the "Browse…" button in the "Data Source" dialog to select the input data file.
select data source
Select a data type to use from the list (e.g.: Microsoft Excel Worksheet), then press "OK". Use the dialog that opens to locate and select the source file, then select the worksheet in the final dialog.
locate source file
Step 6 - Add the Field Mapping
Any fields in the source PDF form will now be listed here. Select the desired field, then press "Add Mapping...".
add field mapping
Check the “Use a multiple-field expression to create a composite field” option.
Type the expression into the entry box provided. Use [Field Name] syntax to refer to an existing data source field. You can mix static text with data field references as any text that is NOT enclosed within square brackets will appear as it's written here. In this example, the separate address components will be inserted in the format shown below.
IMPORTANT: The multi-line option (see step 2) must be enabled under form field properties for this to work - otherwise all data will be shown on a single line.
Note that blank lines entered here are automatically removed from multi-line expressions. This means that addresses can be entered into the form field without any blank lines, if any data fields used for the merge have been left blank. If it’s necessary to create a blank line in the field’s content, do this by using the “{blank}” keyword entered within brackets.
Press “OK” once done.
create expression
sample address output
Step 7 - Select Output Options
Press "Next >" to proceed to the next settings screens.
confirm input settings
Select an output folder using the "Browse..." button.
Optional: use the 'File Naming' section below to create a file naming scheme for the processed files. Enter text before/after a base filename - in this example, the output files will follow a "John_Doe" format. Use [Field Name] syntax to extract data from the source file and insert it into output filenames.
Press "Next >" to proceed through the final settings screens.
confirm output settings
Step 8 - Run the Mail Merge
The confirmed settings summary will now be listed with green circles. Optionally, save the mail merge settings as an *.mms file for later use by pressing "Save Settings". These can be loaded via the "Load Settings" button.
Press "OK" to start the mail merge process.
execute mail merge
Press "Run Mail Merge" to confirm.
confirm the procedure
Step 9 - Open Output Files
A results box will confirm the success of the operation. By default, pressing "OK" will open the selected output location.
view results
Open an output PDF letter to inspect the inserted address lines.
open output PDF
Step 10 - Inspect the Results
Inspect the files to check that all text from the relevant data fields has been entered into the form field. The example below shows a different address inserted into the designated space in each letter. Note that Mary Smith's "State" field was left empty in the data source, so nothing has been inserted in this part of the output address:
sample output letter
output addresses
Examine output documents to make sure that the size of the form field is sufficient to display all necessary text from the data records. Enlarge the field if any text appears to be cut off on some of the output forms, or modify the font size. You can change the size and visual appearance of the text field by re-opening the "Prepare Form" tool (step 1) and repeating the procedure.
Click here for a list of all step-by-step tutorials available.