Placing Code 39 / Code 128 Barcodes on the PDF forms
This tutorial shows how to add Code 39 barcodes to a PDF form using AutoMailMerge™ plug-in for the Adobe® Acrobat®. Use the same instructions with other similar barcode types such as Code 128. Use a different method for creating QR and PDF417 barcodes.
Tutorial Overview
We are going to create the product inventory labels in PDF format for 12 models of chairs. Each product label will be filled with a barcode, an image, and a text description for the product. The data for each product label will be read from an Excel spreadsheet.
The tutorial is going to show how to: The output from the mail merge will be 12 separate PDF files for each product. The barcode field in this tutorial is using the Code 39 symbology to encode a "Product ID" field from the input spreadsheet. The Code 93 is a variable length, discrete barcode symbology that is widely used in many industries and is the standard for many government barcode specifications, including the U.S. Department of Defense. Code 39 is defined in American National Standards Institute (ANSI) standard MH10.8M-1983, and is also known as USD-3 and 3 of 9. Here is a link to Wikipedia article about Code 39 barcode.
The Code 128 barcode font can be used in exactly the same way as Code 39 font.
Input Document Description
The tutorial is using an Excel spreadsheet as a mail merge data source. The spreadsheet contains product information for 12 different models of chairs. There are 5 data fields (columns) in the spreadsheet: "Image", "Title", "Subtitle", "Price" and "Product ID". The data from each row needs to be placed on the PDF form to create individual PDF "product label". The text from the "Product ID" column will be used for the barcode.
Creating barcode in a PDF Form
You need a copy of the Adobe® Acrobat® DC along with the AutoMailMerge™ plug-in installed on your computer in order to use this tutorial. You can download trial versions of both the Adobe® Acrobat® and the AutoMailMerge™.
Step 1 - Download Barcode Code Font
Go to "Google Fonts" repository to download the "Libre Barcode 39 Text" font. If Code 128 symbology is required, get the "Libre Barcode 128 Text" font.
Open a web-browser and go to "" web-page or use the above links.
Open a web-browser
Search for the specific barcode font. As an example, enter "39" in the search box. Find the "Libre Barcode 39 Text" font in the searching results. Click "+" to select the font.
Find code 39 font
Click on the "1 Family Selected" bar in the bottom of the screen to expand the collapsed window.
Expand collapsed window
Click the icon to download the font.
Click to download
The downloaded file will appear in the bottom of the screen (depends on the browser used). Note that if you are using a different web-browser, than the file may appear in the "Downloads" folder. Open the downloaded "" file.
Open the downloaded file
Step 2 - Install the Downloaded Barcode Font
Extract "LibreBarcode39Text-Regular.ttf" font file into some folder.
Extract the file
Open the folder where you have extracted the "LibreBarcode39Text-Regular.ttf" file. Right click on the file. Select "Install" from the pop-up menu. The font will be automatically installed.
Install the file
Once the installation is completed, the "Libre Barcode 39 Text Regular" font will be added to the fonts list. It would be placed into C:\Windows\Fonts folder: .
Check the installed file
Create a PDF Form
Step 3 - Start Adobe Acrobat
Start the Adobe® Acrobat® application. Select the "Tools" from the main toolbar. Select the "Prepare Form" tool to open a form editor.
Open a form editor
Step 4 - Select a PDF form template
Select an existing PDF file that will be as used as a template for the PDF form. It is common to design documents in the text editor such as Microsoft Word, Adobe InDesign, or in any other similar application and then export it into PDF format. The form editor is used only to add fillable forms fields to allow using the document in the mail merge process.
Click here to download the Template PDF file that have been used in the tutorial.
Select a template PDF file
Step 5 - Add a Text Field
Place a text field at the location where a barcode needs to be positioned. Once a PDF file is opened in the "Prepare Form" tool, click the "Add an Text field" icon.
Click Add a Text field icon
Move cursor to a page location where you want to place a text field (barcode). Press and hold left mouse button and drag a rectangle where you want to place a barcode. You will be able to change the position of the field later.
Place a text field
Type a name of the field into a "Field Name" box. Field names are used to uniquely identify each field on a PDF form. We are going to name this field "Product ID". It is a good idea to use the same name for both form and data fields to simplify the field mapping. It is not a requirement, but saves time and make the process more transparent. Click "All Properties" to specify text field properties.
Type a field name
Step 6 - Set Text Field Appearance
  • Select "Auto" from the "Font Size:" menu.
  • Select "Libre Barcode 39 Text" from the "Font:" menu. If the barcode font is not listed in the "Font:" list, then restart the computer.
  • Choose black text color.
  • Choose border and background color ("Fill color"->"No Fill" works the best for most applications).
Next, select the "Options" tab.
Set a barcode font
Select "Center" from the "Alignment:" menu. Uncheck all options. Click "Close" to save.
Uncheck the options
Step 7 - Save the PDF Form
Optionally, add one or more text fields at page locations where variable text needs to be placed. Click the "Add a Text field" icon and place the text field onto the form. See "Populating PDF Forms With Images and Text" for details on how to put images and text on the PDF forms.
Click "Save file" to save changes to the file. Now a previously static PDF document became an interactive PDF form.
Save PDF Form
Step 8 - Preparing Data in the Microsoft Excel
We are going to use an Excel spreadsheet to store the data for the mail merge. Prepare your data in the Microsoft Excel. Below is a spreadsheet example that contains product information for 12 different models of chairs. There are 5 data fields (columns) in the spreadsheet: "Image", "Title", "Subtitle", "Price" and "Product ID". The text from the "Product ID" column will be used for the barcode.
Click here to download the Microsoft Excel file that have been used in the tutorial.
Prepare Data File
Run Mail Merge
Step 9 - Open a PDF Form
Start the Adobe® Acrobat® application and using "File > Open..." menu open a PDF form template that was prepared.
Open a PDF form
Step 10 - Open the "Mail Merge" Dialog
Select "Plug-Ins > Mail Merge..." to open the "Mail Merge" dialog.
Open the Mail Merge dialog
Step 11 - Setup Mail Merge Settings
Press the "Edit Settings..." button to configure the mail merge parameters.
Edit mail merge settings
Step 12 - Select a Data Source
Press the "Browse..." button in the "Data Source" screen to select an input data file.
Select an input data
Select "Microsoft Excel Worksheet (*xls.*xlsx)" from the list:
Select Microsoft Excel Worksheet
Select prepared data source file (use file prepared at the step 8). Click "Open".
Select a source file
Select a sheet from the list. Click "OK".
Select a source sheet
Step 13 - Map Form to Data Fields
Click "Guess Mapping" in the "Data Source" screen. The software will automatically select field correspondence based on field names.
Click Guess Mapping
The confirmation dialog will appear on the screen. Click "Yes" to proceed.
Confirm the operation
The dialog showing the number of field mappings will be displayed. Click "OK".
Close the reporting dialog
Step 14 - Examine the Field Mappings
Examine the field mappings that have been guessed and click "Next >" to advance to the next screen.
Examine the field mappings
Step 15 - Specify Field Options
Optionally, use the "Specify Field Options" screen to control if output form fields should remain editable or not. Make sure to check "Flatten output PDF documents" option to make output documents non-editable. Click "Next >" to advance to the next screen.
Specify field options
Step 16 - Specify Output Options
Use "Select Output Options" screen to control where and how to save output PDF documents. Click "Browse..." to specify an output folder. Optionally, specify the file naming options. Check the "Output a compound document that will contain all filled forms" option if it is necessary to put all output files into a single PDF. Click "Next >" to proceed.
Specify output options
Skip the rest of the screens by clicking "Next>" button multiple times, click "Finish" on the last screen.
Finish specifying
Step 17 - Save Settings
Optionally, save mail merge settings into the *.mms file for later reuse by pressing the "Save Settings" button. Use the "Load Settings" button to load them back at a later time. Click "OK" to advance to the mail merge process.
Save settings
Step 18 - Start Processing
Press the "Run Mail Merge" button in the "Confirm Processing" dialog to start a mail merge process.
Start the mail merge process
The "Mail Merge Results" dialog will appear once the processing is completed. Click "OK" to close this dialog and open an output folder.
Open an output folder
Step 19 - Examine Output Files
Examine output files by opening them in the Adobe Acrobat. There are 12 individual PDF files created in this tutorial:
Examine output files
Here are the examples of the output PDF product labels generated by the mail merge. The Product ID thas been encoded using Code 39 barcode symbology:
Product label examples for Code 39
The following examples are for Code 128 barcode font:
Product label examples for Code 39
You can find a list of other step-by-step tutorials here: