Transcript
Creating Customized Documents with InDesign By Rose Rossello Mail merge is a feature supported by many word processors which enables 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 customized 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 fields from the data set will be used and where to place the field data in the document. Upon running the merge command, the markup is replaced with data from the data set. Some Seybold Report readers may know this process as variable data printing or publishing; these functions are essentially the same as mail merge.
Data Merge in InDesign
Adobe has included mail merge capabilities in every version of InDesign since Creative Suite 4. For this article, we used InDesign CS6. In InDesign, mail merge is referred to as Data Merge. The Data Merge palette is accessible from the top menu bar under Window > Utilities > Data Merge. The palette displays three simple instructions:
The Data Merge palette is located under the Windows > Utilities menu and displays three steps (see image) for creating a merged document. The panel menu (pop out) offers additional options as the merge file is built.
Choose Select Data Source from the panel menu.
text frames) must be placed on the InDesign page so the merge fields can be dragged onto the page. A new InDesign file is generated when the merge is performed. Data field placeholders can also be inserted on InDesign Master pages (versus directly on a document page). When the placeholders are inserted on Master pages, the resulting merged document contains the original placeholders on its Master pages and the merged results on the document pages.
Drag data fields from the panel to frames on the page.
A Simple Merge Product
Choose Create Merged Document from the panel menu. The data source must be a comma-separated or tab-delimited file, and the field names must be the first row in the data. A text frame (or multiple
The Seybold Report • Volume 13, Number 1 • January 7, 2013
In our first project for this article, we used a simple data file containing names and addresses to place the complete contact information in one text frame and the first name (along with some additional text) in a separate frame. The Data Merge palette preview button allows each record to be previewed as the record will appear on the page when merged.
↵ 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, selecting 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 contained one letter per page customized with the data from our data file.
Two text frames were created on the InDesign page. The top frame contains several fields to create the address portion of the letter. The bottom frame uses the First Name field and additional text to complete the letter.
The Seybold Report • Volume 13, Number 1 • January 7, 2013
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 Records and Single Record per Document Page.
↵ 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
Our first project was a fairly simple form letter demonstration, but InDesign can be used to create more complex merges. To illustrate this, we created a multi-column directory for our second project. To begin, we sorted the records alphabetically by the Company field prior to exporting our data set to a comma-separated file. We began the merge process by selecting our data source using the Data Merge palette and then dragged fields on the InDesign page. We then stylized 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, we choose Output Multiple Records per Page in the Data Merge palette when we were ready to perform the merge. Merging multiple records onto a page can present some problems. When a merge is performed, InDesign creates additional text frames for each field from each record, spacing each record based on the settings in the Create Merged Document dialog. If the character count is exactly the same record-to-record or the size the frames is large enough to accommodate 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.
frames, or all frames throughout an entire document. In our project, we used Merge TextFrames to join all of the text frames in the document into one frame with a standard paragraph break between each of the original frames. We then adjusted the resulting merged text frame to match our layout. Note: when merging using multiple records per page where the merge data results in multiple columns on the page, users should select “Top” as the positioning option in Merge TextFrames. If this option is not selected, the text frames will be merged from left to right, then top to bottom instead of top to bottom and then left to right. Using the same data set, we also created a merge with the records sorted alphabetically by the Directory Category field and then by the Company field. InDesign is not sophisticated enough to eliminate duplicate field entries, (in this project the repeating entry was the category designation), so we edited the document manually to remove the duplicate category headings. But, since our data set was small, editing the resulting merged data so only one heading appeared for each category was not a time consuming task.
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 InDesign’s Scripts palette. The extension’s dialog box provides several options including the ability to join all the text frames on a page, only selected
The Seybold Report • Volume 13, Number 1 • January 7, 2013
We applied paragraph and character styles to the data fields prior to creating the merge so InDesign would stylize each entry automatically during the merge process.
↵ 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 category information because InDesign does not offer a means of specifying data only appear with the first occurrence. The duplicate category information must be removed manually to create a single category heading with the corresponding companies 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 importing 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:\Photos\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 required, 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. In this project we used a simple layout with multiple records on a page, but we also created a single record per page layout with multiple images. With this type of project it is necessary to create an additional field in the data file with the full file path for each additional image associated with a record. With each image in its own field, any number of image fields can be placed on the InDesign document page.
The Seybold Report • Volume 13, Number 1 • January 7, 2013
InDesign can also merge data containing references to images. The full path location of the image must be included in the data file, and the field name must include an "@" symbol at the beginning shown here in our spreadsheet). 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 Images Proportionally and Link to the images (versus embedding them) using the Contact Placement Options dialog. We also set the spacing between each record on the Multiple Record tab.
↵ 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 created 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 shared across every record in the data set.) To help simplify the process,
The Seybold Report • Volume 13, Number 1 • January 7, 2013
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.
↵ HOME
< 10 >
we named the image files with the same fruit names used in the recipient’s Interest field, e.g., apple.jpg, pear.jpg, etc. We then created a calculated field combining our global image path field, the Interest field, and appended “.jpg” to complete the full path to the image file. By preparing a data set this way, we were able to generate the custom file paths based on the recipient’s Interest without having to create the path for each record manually. Creating paths automatically is extremely useful and saves time when dealing with large data sets. We used this data set with Data Merge in InDesign to create postcards customized with the image based on each recipient’s interest.
A Useful Merge Tool
InDesign’s merging capabilities are not very sophisticated, but for projects where the data and presentation of the data are consistent and the design is relatively simple, InDesign works well for automating the placement of small and medium data sets. Other tools with more sophisticated capabilities are needed if the data set is large and there is the need to filter fields or perform conditional formatting. For more sophisticated merging, we suggest Em Software’s InData and InCatalog plug-ins to create complex conditional merges as these allow for real-time data updates and process very large data sets quickly. These plug-ins have been around for many years and are available for InDesign and Quark Xpress.
The Seybold Report • Volume 13, Number 1 • January 7, 2013
For our first two projects we could have created our merge file using Microsoft Word and imported the resulting file into InDesign. But, creating and applying paragraph and character styles is easier in InDesign than in Word. Word, however, does have the added ability to create conditional (if/then) statements, which provide the ability to filter a data set based on parameters before merging. For example, in the directory project the category heading repeated for every record. In Word, a conditional statement could be created to show the heading with the first occurrence of a category only. We noticed only a minor time delay importing 70 records with seven images per record (in our catalog project), although we suspect there would not be much more of a delay if importing a few hundred records. Larger data sets can also be used if import time is not a concern. Data can also be imported in batches as the Data Merge palette gives the option of controlling how many records are imported at one time.
Our Take
InDesign’s Data Merge feature is quite handy. With only minor effort, it easy to import data and automate the placement and styling of merged data and images. For more complex jobs, InData and InCatalog are better options. But, for many projects, especially test runs, concept development efforts, and capability demonstrations, InDesign’s Data Merge feature is up to the task. TSR
↵ HOME
< 11 >