Barcodes (2D)

<< Click to Display Table of Contents >>

Navigation:  Programming Techniques >

Barcodes (2D)

Previous pageReturn to chapter overviewNext page

[Professional Edition and above]

VPE is shipped with a sophisticated barcode library, which allows to create the following two-dimensional barcodes:

Data Matrix

QR Code

MaxiCode (UPS)

PDF417

Aztec

 

Modules and Sizing 2D-Barcodes

Modules are the black and white squares. The width of the thin and thick modules have fixed ratios, for example 1:2. This means, thin modules are half as wide as thick modules.

Since there is a fixed aspect ratio, it is obvious that a barcode needs a fixed amount of space depending on its coding scheme and the number of coded characters. A barcode can not be sized freely! It can only be sized in compliance with the aspect ratio.

Example: a given barcode has 63 modules, 43 thick and 20 thin modules, and shall be painted into a rectangle which has a width of 10 cm.

The barcode library now computes the maximum width of a single module, so that all modules will best fit into the given rectangle, while considering the rule that the thin / thick ratio is 1:2. It can happen then that a barcode can not be drawn, because the space is too small, or that there are wide gaps at the end of the barcode, because it can not fill the given rectangle.

If there is not enough space to draw the barcode, a place holder is drawn (a box with two crossing lines).  VPE offers rendering-methods to compute the required size of a given 2D-barcode.

 

Frames Around Barcodes

By default, VPE has selected a pen of 0.3mm width. This causes a frame drawn around barcodes. In order to draw barcodes without a frame, set the PenSize = 0. It is highly recommended to turn off the frame for barcodes, so the quiet zone is not overpainted.