Place barcodes and matrix codes
pdfToolbox allows you to place 1D codes (i.e. barcodes such as EAN 13) and 2D codes (i.e. QR matrix codes or data matrix codes) on PDF pages. pdfToolbox supports over 100 different types of 1D and 2D codes, covering all such codes used in practice. Extensive information regarding the various 1D and 2D codes can be found in the pdfToolbox Reference Manual.
This help article uses the example of an EAN 13 code to describe how 1D and 2D codes can be placed on a page and how these can be adapted to your individual requirements. This help article assumes that you are using the standalone callas pdfToolbox Desktop edition. However, the same functionality is also available if you use the plugin version of callas pdfToolbox Desktop within Adobe Acrobat Pro. The functionality of this tool is identical whether on Mac OS X or Windows. This function can be automated under callas pdfToolbox Desktop using the Batch function, or with callas pdfToolbox Server (on Mac OS X and Windows, in particular when also using Enfocus Switch and FileTrain from LaidBack Solutions) and callas pdfToolbox CLI (on Linux). The pdfToolbox SDK (on Mac OS X, Windows and Linux) also offers similar options for developers.
Open the “Fixups” window in pdfToolbox
To open the Fixups window, click on the Fixups option in the menu or press ⌘+5 / Cmd+5 (on Mac OS X) or Ctrl+5 (on Windows).
Use the search field to find the Fixup with a name including “EAN”
- Enter “EAN” in the search box to restrict the list of Fixups shown to those containing the term “EAN”.
- Select the Fixup named “Place EAN 13 barcode with specified value”
- Click “Fix” to place the EAN 13 barcode.
Important: There must already be an open document.
"Beginning with version 9, you will find this Fixup in the Library "Shapes, Variables, JavaScript, Place content".
Optional: specify the value of the EAN 13 barcode to be placed
A dialog window will appear where you can enter the value for the EAN 13 barcode that will be placed in the file. If no entry is given, the default value will be used.
Important: The value entered must consist of 12 or 13 digits. If 12 digits are entered, pdfToolbox will automatically calculate the required check digit. If 13 digits are entered, the 13th must be a valid check digit, otherwise the attempt to place the barcode will return an error. When testing the system, provide a 12-digit value.
Enter a 12-digit value to test the placement of the EAN 13 barcode
Save the altered PDF
Important: If in doubt, please double-check that the original document will not be overwritten. Choose a new file name or save the document in another directory.
Result report after completion
After processing is complete, pdfToolbox will display a report on the results. In this example, 346 barcodes have been placed (one code on each of the 346 pages).
View the PDF with added EAN 13 barcode
Barcode placed on a later page of the PDF document.
Clearly, the positioning of the EAN 13 code as shown here will not be suitable in most cases. In practice, you will usually need to make adjustments to the position of the barcode on the page as well as its size. Consider also whether a barcode is required on every page or only on certain pages.
These adjustments are easy to make, as the following steps will show.
callas pdfToolbox: Duplicate Fixup
Duplicating a Fixup creates a virtually identical copy (item 2) of the original Fixup - with the only difference being that “(Copy 1)” has been added to the name (item 1).
In order to adapt the Fixup named “Place EAN 13 barcode with specified value” to your own requirements, it is usually advisable to create a copy of the existing Fixup and make the required changes to this copy.
“Place EAN 13 barcode with specified value” - original settings
This graphic shows the original settings to which we will make a number of changes in order to correctly position and color the EAN 13 code.
“Place EAN 13 barcode at bottom left” - with settings adjusted
For the following steps, we will assume that a variant is required which places the EAN 13 code
- with a font picked from the computer
- at the bottom left of the page
- colored in a specific dark blue which we will name “EAN13-Spotcolor”
- not on a layer
All other settings, such as the size of the EAN 13 code or the font type for the code’s digits, will be preserved.
- 'Method' allows to add:
- Font families
- Web fonts
- Fonts from library
- Upon selecting 'Fonts from library' method, fonts can be imported from the system
- The barcode’s position will now be relative to the bottom-left corner of the page
- Options to create a layer and assign the barcode to this layer have now been disabled
- The CMYK color values have been adjusted, resulting in a dark blue color instead of black
- “Create as spot color” has been enabled, and the name of the spot color has been given as “EAN13-Spotcolor”
Updated Fixup: “Place EAN 13 barcode at bottom left”
Click “Fix” to call the updated Fixup for the current open document.
Optional: specify the value of the EAN 13 barcode to be placed
Enter the name and directory for the finished output file
EAN 13 barcode now positioned at bottom left
The EAN 13 code is now located at the bottom left corner of the page.