- 6 minutes to read
Barcodes are machine-readable versions of text elements. They are used to place text information on the design that a scanner can read. There are many types, from QR codes that are read by any modern smartphone to GS1 barcodes used exclusively in retail or logistics industries.
In this article, we describe how to work with barcodes in the Template Editor.
For more information, see the Barcodes description in the Design anatomy section.
Creating the barcode
You can create barcodes using the top toolbar:
You may also press
B to create a barcode or
Q to create a QR code. In edit mode, stretch the rectangle. When you release the mouse, a barcode will be created in place of this rectangle.
When creating a barcode, remember that it will be scanned by a device, which has some physical limitations. A barcode that is too large or too small will be impossible to scan. Refer to standards and specifications that dictate the barcode size and line thickness for a specific barcode type.
Editing the barcode
The barcode has two main parameters:
value. For different formats, additional requirements may be imposed on the value.
For example, for EAN-13, it should be a 12-digit number (or 13-digit, but the last digit should be checksum calculated by a special algorithm), and for CODE-128, it can be any ASCII characters.
Leave the value empty when it needs to be filled in by end-users or when it is automatically filled in during variable data printing. In such cases, the editor displays a dulled barcode with the label No data on top of it. If the user does not enter anything there, then the barcode will not be displayed on the printed file.
If you need to display a fixed barcode on the template that is not supposed to be changed (for example, a QR code with the address of the company's website), you can enter the values directly into the Template Editor. If the value is invalid, you will see a hint explaining the reason.
Additional barcode properties
On the Design tab, in the Barcode Options, you can find additional settings:
Margin. You can set up an additional margin for the barcode.
Pure barcode. If this property is enabled, only the barcode will be displayed. If disabled, the encoded value is duplicated under the barcode.
For some barcode formats, these settings are ignored. They are relevant mainly for 1D barcodes. Margin is also used for some 2D barcodes.
- The barcode color. You can change the barcode background color by editing Fill color.
Scanners may misinterpret barcodes with poor contrast. Try to use a black barcode on a white background. Check the result with scanners.
Different types of barcodes
This is the most common type of barcode. It can be recognized from any modern smartphone. It is used to encode website addresses, phone numbers, and contact details.
When you choose a QR code, you get an additional property called Subtype.
This property has four values:
- None: the QR code has no special meaning.
- URL: a website address.
- Phone: a phone number.
- vCard: contact details in vCard format, suitable for importing into the phone's address book.
For the first three subtypes, you can edit the value as a regular string. For vCard, the Edit button appears in place of the value, which opens a window for entering contact data.
For QR codes, you can use
Margin as described above, but not the
Pure barcode. Its value is never output.
These barcodes are used to label products in retail. UPC is designed for use in the United States.
There are two versions:
- UPC-A (12-digit). This is a more common barcode.
- UPC-E (8-digit). This is used only when there is no space for a full-fledged UPC-A.
UPC barcode structure:
N LLLLL RRRRR C
N XXXXXX C
N — numbering system.
For UPC-A, you can specify any value from 0 to 9. But depending on this value, the interpretation of the barcode values
0-1, 6-8 — are used for retail products.
LLLLLis the manufacturer's code and
RRRRRis the product code.
2 — is used for weight-based pricing.
LLLLLis the product code and
RRRRRis the weight or the price.
3 — is used for pharmaceutical products. Both groups of digits are interpreted as a 10-digit National Drug Code (NDC) number.
4 — reserved for use by individual stores, for example, for loyalty cards. You need to specify the
5 — is used for coupons.
LLLLLis the manufacturer's code and
RRRRRencodes the product (the first three characters) and the discount amount (the last two digits).
С — checksum.
If you don't enter this digit, Customer's Canvas will automatically calculate it and use it when generating the code. This means you can enter 11 digits for UPC-A or 7 digits for UPC-E. If you enter this number, Customer's Canvas will check its accuracy. If it is incorrect, it will display a message.
For UPC-E, only 0 and 1 values are valid as N. The last digit of
XXXXXX determines which part of the code refers to the product and which part refers to the manufacturer. You can find the algorithm that determines this and calculates how to translate between UPC-A and UPC-E in the Wikipedia article about UPC-E.
For UPC barcodes, both
Pure barcode work. As usual, the Pure barcode option is off for this barcode type.
EAN-13 and EAN-8 are international versions of UPC-A and UPC-E, respectively.
EAN differs from UPC by an additional character at the beginning of the line. If you add 0 to the beginning of the UPC value, it will be a valid EAN value, and the barcode will look identical.
EAN barcode structure:
The first three characters are the GS1 Prefix, which encodes the GS1 member organization. As usual, it is the code of a country where the identifier was issued, but some values are reserved for a separate type of product. For example, the number 976 means ISBN (books), 979 followed by 0 is ISMN (sheet music), etc. You can find a complete list of these codes on the GS1 website.
The rest of the code body includes both manufacturer and product codes. But unlike UPC, their length may vary.
The last digit of this barcode also stores a checksum. Like for UPC, Customer's Canvas can automatically calculate a checksum if you omit it. If you enter a checksum, Customer's Canvas will validate it.
For EAN barcodes, Margin and Pure barcode work. As usual, the Pure barcode option is off for this barcode type.
Intelligent Mail Barcode (IMB)
This barcode is used by the USPS to dispatch mail.
You may encounter the need to use this barcode if you are using Customer's Canvas as part of a Direct Mail solution.
IMB barcodes support two types of values:
- a digital code with a length of 20-31 characters, for example,
- or an encoded sequence of four letters — F, T, A, D with a length of 65 characters, for example,
Customer's Canvas supports both options. For more details, see information on the USPS website.
It is very unlikely that you need to enter these values while designing a template. Typically, you just need to create an empty barcode and populate it when processing templates through API. It is supposed that you use USPS API to obtain these values.
Pure barcode properties are ignored for this barcode type.
Let's go further and learn how to set up auto-layouts.