Placing Code 39 / Code 128 Barcodes on the PDF forms
- Introduction
- 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:
- Download a barcode font and install it under Microsoft Windows.
- Create a text field for the barcode on a PDF form template.
- Prepare data in Excel.
- Run mail merge to create barcodes using data from an Excel spreadsheet.
- 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.
- Prerequisites
- 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 "https://fonts.google.com" web-page or use the above links.
- 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.
- Click on the "1 Family Selected" bar in the bottom of the screen to expand the collapsed window.
- Click the icon to download the font.
- 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 "Libre_Barcode_39_Text.zip" file.
- Step 2 - Install the Downloaded Barcode Font
- Extract "LibreBarcode39Text-Regular.ttf" font file into some folder.
- 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.
- 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: .
- 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.
- 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.
- 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.
- 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.
- 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.
- 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).
- Select "Center" from the "Alignment:" menu. Uncheck all options. Click "Close" to save.
- 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.
- 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.
- 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.
- Step 10 - Open the "Mail Merge" Dialog
- Select "Plug-Ins > Mail Merge..." to open the "Mail Merge" dialog.
- Step 11 - Setup Mail Merge Settings
- Press the "Edit Settings..." button to configure the mail merge parameters.
- Step 12 - Select a Data Source
- Press the "Browse..." button in the "Data Source" screen to select an input data file.
- Select "Microsoft Excel Worksheet (*xls.*xlsx)" from the list:
- Select prepared data source file (use file prepared at the step 8). Click "Open".
- Select a sheet from the list. Click "OK".
- 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.
- The confirmation dialog will appear on the screen. Click "Yes" to proceed.
- The dialog showing the number of field mappings will be displayed. Click "OK".
- Step 14 - Examine the Field Mappings
- Examine the field mappings that have been guessed and click "Next >" to advance to the next screen.
- 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.
- 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.
- Skip the rest of the screens by clicking "Next>" button multiple times, click "Finish" on the last screen.
- 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.
- Step 18 - Start Processing
- Press the "Run Mail Merge" button in the "Confirm Processing" dialog to start a 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.
- 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:
- 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:
- The following examples are for Code 128 barcode font:
- You can find a list of other step-by-step tutorials here: https://www.evermap.com/tutorialsList.asp.