Barcodes

Informations

Author: Olivier
License: Freeware

Description

This script implements EAN13 and UPC-A barcodes (the second being a particular case of the first one). Bars are drawn directly in the PDF (no image is generated).

EAN13(float x, float y, string barcode [, float h [, float w]])

x: abscissa of barcode.
y: ordinate of barcode.
barcode: value of barcode.
h: height of barcode. Default value: 16.
w: width of a bar. Default value: 0.35.

UPC_A(float x, float y, string barcode [, float h [, float w]])

Same parameters.

An EAN13 barcode is made up of 13 digits, UPC-A of 12 (leading zeroes are added if necessary). The last digit is a check digit; if it's not supplied, it will be automatically computed.

If you want to print other kinds of barcodes, you can use the class available here (LGPL) and here (GPL). They make use of the GD library and support many types of barcodes. You'll have to generate a PNG and include it in the PDF.
For POSTNET barcodes, see this script.