You are on page 1of 11

Creating Customized Documents with InDesign

By Rose Rossello

Mail merge is a feature supported by many word processors which en-


ables the creation of personalized documents. The majority of people
use only the most basic aspects of mail merge, such as creating form
letters and labels. But, with a little preparation, a wide variety of custom-
ized documents can be created using InDesign’s data merge capabilities.

The Basics
To create a merged document two files are required: a delimited data
set, such as a customer database in comma-separated or tab-delimited
format, and a document containing special markup to indicate which The Data Merge palette is located under the
fields from the data set will be used and where to place the field data Windows > Utilities menu and displays three steps
in the document. Upon running the merge command, the markup is (see image) for creating a merged document. The
replaced with data from the data set. Some Seybold Report readers may panel menu (pop out) offers additional options as the
know this process as variable data printing or publishing; these func- merge file is built.
tions are essentially the same as mail merge.

Data Merge in InDesign


Adobe has included mail merge capabilities in every version of InDesign text frames) must be placed on the InDesign page so the merge fields
since Creative Suite 4. For this article, we used InDesign CS6. In InDesign, can be dragged onto the page. A new InDesign file is generated when
mail merge is referred to as Data Merge. The Data Merge palette is ac- the merge is performed. Data field placeholders can also be inserted on
cessible from the top menu bar under Window > Utilities > Data Merge. InDesign Master pages (versus directly on a document page). When the
The palette displays three simple instructions: placeholders are inserted on Master pages, the resulting merged docu-
ment contains the original placeholders on its Master pages and the
„„ Choose Select Data Source from the panel menu. merged results on the document pages.

„„ Drag data fields from the panel to frames on the page. A Simple Merge Product
In our first project for this article, we used a simple data file containing
„„ Choose Create Merged Document from the panel menu. names and addresses to place the complete contact information in one
text frame and the first name (along with some additional text) in a sep-
The data source must be a comma-separated or tab-delimited file, and arate frame. The Data Merge palette preview button allows each record
the field names must be the first row in the data. A text frame (or multiple to be previewed as the record will appear on the page when merged.

The Seybold Report • Volume 13, Number 1 • January 7, 2013 ↵ HOME < 1 >
In this project, some of the records we used had no second address line.
To avoid generating a blank line when the second address field was
empty, we accessed the Content Placement Options in the Data Merge
palette and checked Remove Blank Lines for Empty Fields.

With the document now ready, we clicked the Create Merge Document
button on the bottom right of the Data Merge palette. The dialog box
provides additional options such as limiting the number of records, se-
lecting a range of records, and choosing if the data should be merged
with one record per page or multiple records per page. For this project,
we chose all records and one record per page. Our resulting file con-
tained one letter per page customized with the data from our data file. Clicking the preview button in the Data Merge palette allows the user to
preview how the data will look on the page once merged. The Content
Placement Options, accessible from the Data Merge palette options menu,
allow blank lines, which occur when there is no data in a field, to be removed
before a merge. When we were ready to merge, we pressed the Create Merge
Document button in the lower right corner of the Data Merge palette

The Create Merged


Document dialog box
allows users to select how
many records to merge
and whether to place one
record per page or multiple
records on a page. In our
first project, we chose All
Two text frames were created on the InDesign page. The top frame contains Records and Single Record
several fields to create the address portion of the letter. The bottom frame per Document Page.
uses the First Name field and additional text to complete the letter.

The Seybold Report • Volume 13, Number 1 • January 7, 2013 ↵ HOME < 2 >
Side-by-side comparison. The document with merge fields (left) and
the final merged document (right).

The Seybold Report • Volume 13, Number 1 • January 7, 2013 ↵ HOME < 3 >
A Complex Example frames, or all frames throughout an entire document. In our project, we
Our first project was a fairly simple form letter demonstration, but InDe- used Merge TextFrames to join all of the text frames in the document
sign can be used to create more complex merges. To illustrate this, we into one frame with a standard paragraph break between each of the
created a multi-column directory for our second project. original frames. We then adjusted the resulting merged text frame to
match our layout. Note: when merging using multiple records per page
To begin, we sorted the records alphabetically by the Company field where the merge data results in multiple columns on the page, users
prior to exporting our data set to a comma-separated file. We began should select “Top” as the positioning option in Merge TextFrames. If this
the merge process by selecting our data source using the Data Merge option is not selected, the text frames will be merged from left to right,
palette and then dragged fields on the InDesign page. We then stylized then top to bottom instead of top to bottom and then left to right.
the fields using paragraph and character styles. In order to have more
than one record per page appear on the page in the merged document, Using the same data set, we also created a merge with the records sorted
we choose Output Multiple Records per Page in the Data Merge palette alphabetically by the Directory Category field and then by the Company
when we were ready to perform the merge. field. InDesign is not sophisticated enough to eliminate duplicate field
entries, (in this project the repeating entry was the category designa-
Merging multiple records onto a page can present some problems. When tion), so we edited the document manually to remove the duplicate cat-
a merge is performed, InDesign creates additional text frames for each egory headings. But, since our data set was small, editing the resulting
field from each record, spacing each record based on the settings in the merged data so only one heading appeared for each category was not
Create Merged Document dialog. If the character count is exactly the a time consuming task.
same record-to-record or the size the frames is large enough to accom-
modate the record with the highest character count, the text frames in
the resulting merged InDesign document will be evenly spaced with no
overset text. However, in our data set, the information varied in length,
resulting in overset text and uneven spacing between records.

There are two options for addressing these issues. The first is to extend
each overset text frame and reposition each box manually on the page
to match the desired layout. The second is to combine all the text into a
single frame by dragging the frame link marker of one text frame to the
one immediately above it so the text can be reflowed into the layout as
a single unit. Using InDesign by itself, these options are tedious manual
tasks. However, we were able to resolve these issues after merging the
data by using a free InDesign extension from Ajar Productions called
Merge TextFrames, which can be downloaded here.

Once installed, the Merge TextFrames extension is accessible from InDe- We applied paragraph and character styles to the data fields prior to creating
the merge so InDesign would stylize each entry automatically during the
sign’s Scripts palette. The extension’s dialog box provides several options
merge process.
including the ability to join all the text frames on a page, only selected

The Seybold Report • Volume 13, Number 1 • January 7, 2013 ↵ HOME < 4 >
We used the Multiple Record Layout
tab in InDesign's Data Merge Palette
to preview the document with
the merged data. However, in this
project, the margins and spacing
are for previewing purposes only.
The screen shot shows a preview of
how the page will look when the
data has merged. It shows several
instances of overset text (indicated
by the red square icons), and the
uneven spacing between entries.
Text overflow and spacing issues can
happen when the length of data
varies from record to record. After
the merge users have the option of
manually extending each overset
text box and repositioning each
box on the page or combining all
the text into a single frame. Using
InDesign alone, these options are
tedious manual tasks. However, we
were able to resolve these issues
after merging the data by using the
Merge TextFrames extension.

Accessing the Merge TextFrames extension


from InDesign’s Scripts palette allowed us to
define how to combine the text into a single
text frame. Here we choose to apply the Merge
TextFrames to all pages in the document,
sorting from the left and inserting a hard
carriage return to separate each entry. In order
to maintain our alphabetical sorting we chose
“left” so the text frames would be combined
first top to bottom and then left to right
because in our original merge settings (above)
we merged into multiple columns arranged by
columns first.

The Seybold Report • Volume 13, Number 1 • January 7, 2013 ↵ HOME < 5 >
Merged TextFrames results in a single text frame.

With the text consolidated into one frame, we expanded the frame to span the width of the page and
changed the text frame options to four columns to match our layout.

The Seybold Report • Volume 13, Number 1 • January 7, 2013 ↵ HOME < 6 >
Each record in the merged
document contains the cat-
egory information because
InDesign does not offer a
means of specifying data
only appear with the first oc-
currence. The duplicate cat-
egory information must be
removed manually to create
a single category heading
with the corresponding com-
panies under it.

Here is the merged data with the multiple


headings removed. We also adjusted our
paragraph styles to achieve a more pleasing
layout. If a large data set is used, using
Microsoft Word to create the final document
with the merge data would be more efficient
as the user can eliminate the duplicate
headings using a conditional statement
before importing the merged text into
InDesign. But, if this work is done in Word,
styles need to be carefully assigned in Word
to avoid time consuming manual text styling
changes in InDesign.

The Seybold Report • Volume 13, Number 1 • January 7, 2013 ↵ HOME < 7 >
Creating Catalogs with InDesign
Our third project incorporated images into the data mix, demonstrating
the ability to use Data Merge for simple catalog generation. Before im-
porting a data file with images into InDesign, we had to first put an at
symbol (@) at the beginning of the each data field name referencing an
image file. This step makes InDesign recognize the field is for an image,
not text. Our data set also needed to include the full path and file name
of the image for each record. Paths, which are case-sensitive, must follow
the naming conventions of the operating system used on the computer in
which the images are stored. For example, a Windows-based PC, the path
would be constructed as C:\[Folder Name]\[Image Name ](e.g., C:\Pho-
tos\BillTucker.jpg) On a Mac, a path might be constructed as [Hard Drive
Name]:[Folder Name]:[File Name] (e.g., Mac HD:Photos:BillTucker.jpg)

Incorporating this data set into InDesign was done the same way as in
the other projects we created for this article. Note: the image field can
be placed in the same field as the other data (i.e., inline), but for layout
purposes we chose to place each image in its own frame as inline images
can produce unpredictable results. We tried a few scenarios and were
unable to create anything very appealing using inline images. However,
inline images can work well if text does not need to be wrapped around,
or placed beside, an image. If either of these types of placements are re-
quired, placing an image in its own frame makes the merge and design
process much simpler and faster.

Since we planned to keep each record in its own frame after the merge,
we used the Multiple Record layout settings in InDesign’s Data Merge
palette to create some space between each record. During the merge,
InDesign places the images on the page along with the rest of the data. InDesign can also merge data containing references to images. The full path
In this project we used a simple layout with multiple records on a page, location of the image must be included in the data file, and the field name
but we also created a single record per page layout with multiple imag- must include an "@" symbol at the beginning shown here in our spreadsheet).
es. With this type of project it is necessary to create an additional field in Upon selecting this file in InDesign, the Data Merge palette displays an image
icon next to the image field. Before merging the document, we also chose Fit
the data file with the full file path for each additional image associated
Images Proportionally and Link to the images (versus embedding them) using
with a record. With each image in its own field, any number of image the Contact Placement Options dialog. We also set the spacing between each
fields can be placed on the InDesign document page. record on the Multiple Record tab.

The Seybold Report • Volume 13, Number 1 • January 7, 2013 ↵ HOME < 8 >
In this project we
wanted each record to
remain in a separate
text frame so we
could be certain the
spacing between text
and images would be
uniform.

An alternate layout using the same data set. We placed


multiple images on a page, but only one record per page.
Each image reference must appear in a separate field in the
data set in order for the images to be placed as desired on
the InDesign page.

The Seybold Report • Volume 13, Number 1 • January 7, 2013 ↵ HOME < 9 >
Creating Personalized Postcards
Personalized postcards are a popular variable data project, as several
PODi case studies published in the Seybold Report demonstrate. Some
printers use specific tools sold with, or created to be used with, their
digital press to merge variable data during the imaging process, but it
can be less expensive for printers and their customers if the piece is cre-
ated with the data merged with the design before press time.

For example, a postcard with the recipient’s name and accompanying


image selected based on data in a field can be created using InDesign.
In our example we created an Interest field, which contained the name
of a fruit the recipient preferred. We then created a series of images of
fruits named to correspond to the data in the Interest field and denoted
the image path in our data file.

To automate the creation of these image data file paths, we used field
calculations in the database. To generate these calculations, we created
a global field in our data file indicating the general location of all of our
images, such as Mac HD:Photos. (A global field is a field whose data is We created a postcard using a different image correlated to each recipient's
choice of favorite fruit. We used images of various fruits in this project.
shared across every record in the data set.) To help simplify the process,

The Seybold Report • Volume 13, Number 1 • January 7, 2013 ↵ HOME < 10 >
we named the image files with the same fruit names used in the recipi- For our first two projects we could have created our merge file using Mi-
ent’s Interest field, e.g., apple.jpg, pear.jpg, etc. We then created a calcu- crosoft Word and imported the resulting file into InDesign. But, creating
lated field combining our global image path field, the Interest field, and and applying paragraph and character styles is easier in InDesign than in
appended “.jpg” to complete the full path to the image file. By preparing Word. Word, however, does have the added ability to create conditional
a data set this way, we were able to generate the custom file paths based (if/then) statements, which provide the ability to filter a data set based
on the recipient’s Interest without having to create the path for each on parameters before merging. For example, in the directory project
record manually. Creating paths automatically is extremely useful and the category heading repeated for every record. In Word, a conditional
saves time when dealing with large data sets. We used this data set with statement could be created to show the heading with the first occur-
Data Merge in InDesign to create postcards customized with the image rence of a category only.
based on each recipient’s interest.
We noticed only a minor time delay importing 70 records with seven
A Useful Merge Tool images per record (in our catalog project), although we suspect there
InDesign’s merging capabilities are not very sophisticated, but for proj- would not be much more of a delay if importing a few hundred records.
ects where the data and presentation of the data are consistent and Larger data sets can also be used if import time is not a concern. Data
the design is relatively simple, InDesign works well for automating the can also be imported in batches as the Data Merge palette gives the op-
placement of small and medium data sets. Other tools with more so- tion of controlling how many records are imported at one time.
phisticated capabilities are needed if the data set is large and there is the
need to filter fields or perform conditional formatting. Our Take
InDesign’s Data Merge feature is quite handy. With only minor effort, it
For more sophisticated merging, we suggest Em Software’s InData and easy to import data and automate the placement and styling of merged
InCatalog plug-ins to create complex conditional merges as these al- data and images. For more complex jobs, InData and InCatalog are bet-
low for real-time data updates and process very large data sets quickly. ter options. But, for many projects, especially test runs, concept devel-
These plug-ins have been around for many years and are available for opment efforts, and capability demonstrations, InDesign’s Data Merge
InDesign and Quark Xpress. feature is up to the task. TSR

The Seybold Report • Volume 13, Number 1 • January 7, 2013 ↵ HOME < 11 >

You might also like