Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

LazBarcodes

General

About

LazBarcodes is a set of controls to create 1D and 2D barcodes. The backend engine is a port of Zint at sourceforge. Some units were heavily refactored to obtain a more Pascal-like code.

The library supports the generation of 1D and 2D barcodes:

Author

2011 - Jose Mejuto

License

BSD 3 as it is being inherited from the zint source code.

Dependencies / System Requirements

Getting LazBarcodes

The download contains the packages lazbarcodes and lazbarcodes_runtimeonly. The first one gives you visual components of the above barcodes and the second can be used just to access the ported zint code for advanced barcode generation.

Development version

The latest source code can be found on Lazarus-CCR. Use SVN to load the source files, or download the "Snapshot" by clicking on the corresponding button of the sourceforge site and unzip it to some directory. For installation go to "Package" > "Load package file (*.lpk)", navigate to the folder with the downloaded sources and load the fole lazbarcodes_runtimeonly.lpk. Then load the package lazbarcodes.lpk. Click "Use" > "Install", and confirm the question to rebuild the IDE. After some time the IDE restarts, and you find the barcodes in the "LazBarcodes" tab of the component palette.

Release version

Occasionally a release version is prepared and made available for easy installation by means of the Online-Package-Manager in the Lazarus IDE. Open "Package" > "Online package manager", check the item "LazBarcodes" in the list and click "Install". Again, confirm the question to rebuild the IDE. When the IDE restarts after some time you find the barcodes in the "LazBarcodes" tab of the component palette.

Change Log

Documentation

General

The components installed by the LazBarcodes package descent from TGraphicControl and thus inherit fundamental control properties such as Width, Height, AutoSize, etc. They share a variety of other properties and methods; some properties, however, are not published fwhen they are not appropriate for the current barcode type.

Properties

Methods

Components

1D codes

Component BarcodeType Name Application Allowed chars Text length Reference
Tbarcode2of5.png TBarcode2of5 bctCode25Standard Standard 2-of-5, or Matrix 2-of-5 Warehouse sorting; photo finishing; airline ticket marking '0'..'9' up to 80 https://en.wikipedia.org/wiki/Matrix_2_of_5
bctCode25DataLogic DataLogic 2-of-5 Processing and sorting of mail for the Chinese Postal Service '0'..'9' up to 80 https://en.wikipedia.org/wiki/Matrix_2_of_5
bctCode25IATA IATA 2-of-5 Airline cargo '0'..'9' up to 45 https://en.wikipedia.org/wiki/Industrial_2_of_5#IATA_2_of_5
bctCode25Industrial Industrial 2-of-5 Cardboard printing; photo developing envelopes; warehouse sorting systems '0'..'9' up to 45 https://en.wikipedia.org/wiki/Industrial_2_of_5
bctCode25Interleaved Interleaved 2-of-5 135 film; cartons of some products '0'..'9' up to 89 https://en.wikipedia.org/wiki/Interleaved_2_of_5
bctITF14 ITF-14 Packaging levels of a product '0'..'9' up to 13 https://en.wikipedia.org/wiki/ITF-14
Tbarcode3of9.png TBarcode3of9 bctCode39; bctLOGMARS Code 3-of-9 (C39); LOGMARS Name badges, inventory and industrial applications; LOGMARS: different bar widths '0'..'9', 'A'..'Z', ' ', '–', '.', '$', '/', '+', '%' up to 74 https://en.wikipedia.org/wiki/Code_39
bctCode39Ext Extended Code 3-of-9 (C39ext) Name badges, inventory and industrial applications #0..#127 up to 74 https://en.wikipedia.org/wiki/Code_39#Full_ASCII_Code_39
bctCode93 Code-93 Canada post like C39 up to 107 https://en.wikipedia.org/wiki/Code_93
Tbarcodec11.png TBarcodeC11 Code-11 Telecommunication '0'..'9', '-' up to 121 https://en.wikipedia.org/wiki/Code_11
Tbarcodec128.png TBarcodeC128 bctC128 Code-128 Industrial applications #0..#127 up to 160 https://en.wikipedia.org/wiki/Code_128
bctEAN128 EAN-128, or GS1-128 Industrial applications #0..#127 Depending on "Application identifier"; to be given in square parenthesis https://en.wikipedia.org/wiki/GS1-128
Tbarcodechannelcode.png TBarcodeChannelCode Channel Code high densitiy codes '0'..'9' up to 7 https://barcodeguide.seagullscientific.com/Content/Symbologies/Channel_Code.htm
Tbarcodeean.png TBarcodeEAN bctEAN EAN-8, EAN-13 Article numbers '0'..'9'; '+' for addon code up to 19 https://en.wikipedia.org/wiki/International_Article_Number
bctEAN14 EAN-14 Trading goods '0'..'9' up to 13 https://www.barcodestalk.com/ean14
bctISBN ISBN Books '0'..'9', 'X'; '+' for addon code 9, 10 or 13 https://en.wikipedia.org/wiki/International_Standard_Book_Number
bctNVE18 NVE-18 Shipping and storage '0'..'9' up to 25
bctUPCA UPC/A Trade items '0'..'9'; '+' for addon code up to 10; plus 2 check digits https://en.wikipedia.org/wiki/Universal_Product_Code
bctUPCE UPC/E Trade items (more compact than UPC/A) '0'..'9'; '+' for addon code up to 7 https://en.wikipedia.org/wiki/Universal_Product_Code#UPC-E
Tbarcodemedical.png TBarcodeMedical bctCodabar Codabar Blood identification '0'..'9', '-', '$', ':', '/', '.', '+', 'A', 'B', 'C', 'D' up to 60 https://en.wikipedia.org/wiki/Codabar
bctCode32 Code 32 (Italian PHARMACODE) Pharmaceutical products in Italy '0'..'9' up to 8 https://barcodeguide.seagullscientific.com/Content/Symbologies/Code_32.htm
bctPharmaOne Pharmacode One-Track Packaging of pharmaceutical products '0'..'9' up to 6 https://barcode-test.com/301/what-is-pharmacode/
bctPharmaTwo Pharmacode Two-Track Packaging of pharmaceutical products '0'..'9' up to 8 https://barcodeguide.seagullscientific.com/Content/Symbologies/TwoTrackPharmacode.htm
bctPZN7 Pharmazentralnummer (PZN) Identification of pharmaceutical products (Germany, Austria) '0'..'9' 7 (6 by user + 1 auto-generated check digit) https://barcodeguide.seagullscientific.com/Content/Symbologies/PZN.htm
bctPZN8 Pharmazentralnummer (PZN) Identification of pharmaceutical products (Germany, Austria) '0'..'9' 8 (7 by user + 1 auto-generated check digit) https://barcodeguide.seagullscientific.com/Content/Symbologies/PZN.htm
Tbarcodeplessey.png TBarcodePlessey bctPlessey Plessey Shelf tags in retail stores '0'..'9', 'A'..'F' up to 65 https://en.wikipedia.org/wiki/Plessey_Code
bctMSIPlessey MSI/Plessey Shelf tags in retail stores '0'..'9' depending on checkdigits (see CheckChar property below) https://en.wikipedia.org/wiki/MSI_Barcode
Tbarcodepostal.png TBarcodePostal bctAustraliaPostCustomer Australia Post Standard Customer Barcode Postal code and automatic mail sorting in Australia '0'..'9', 'A'..'Z', 'a'..'z', space and hash ('#') 8, 13, 16, 18, or 23 http://www.neodynamic.com/Products/Help/BarcodeWPF3.0/barcodes/AustraliaPost.htm; http://fileformats.archiveteam.org/wiki/Australia_Post_standard_customer_barcode
bctAustraliaPostReplyPaid Australia Post Reply Paid Postal code and automatic mail sorting in Australia '0'..'9' 8 http://www.neodynamic.com/Products/Help/BarcodeWPF3.0/barcodes/AustraliaPost.htm; http://fileformats.archiveteam.org/wiki/Australia_Post_standard_customer_barcode
bctAustraliaPostRoute Australia Post Routing Postal code and automatic mail sorting in Australia '0'..'9' 8 http://www.neodynamic.com/Products/Help/BarcodeWPF3.0/barcodes/AustraliaPost.htm; http://fileformats.archiveteam.org/wiki/Australia_Post_standard_customer_barcode
bctAustraliaPostRedirect Australia Post Redirection Postal code and automatic mail sorting in Australia '0'..'9' 8 http://www.neodynamic.com/Products/Help/BarcodeWPF3.0/barcodes/AustraliaPost.htm; http://fileformats.archiveteam.org/wiki/Australia_Post_standard_customer_barcode
bctDAFT DAFT Code Generic system of transcribing 4-state barcodes where the data encoding is provided by an external program. 'D': Descender; 'A': Ascender; 'F': Full height; 'T': Tracker (short bar) up to 50 https://www.neodynamic.com/barcodes/DAFT-4-state-Barcode.aspx
bctDeutschePostIdentCode Deutsche Post Identcode Mail routing in Germany '0'..'9' (up to) 11 digits https://barcodeguide.seagullscientific.com/Content/Symbologies/Identcode.htm
bctDeutschePostLeitCode Deutsche Post Leitcode Specifies destination for mail in Germany '0'..'9' (up to) 14 digits https://barcodeguide.seagullscientific.com/Content/Symbologies/Leitcode.htm
bctFIM FIM (Facing Identification Mark) Automatic facing, or orientation, of the mail piece for cancellation 'A'..'D', 'a'..'d' 1 https://en.wikipedia.org/wiki/Facing_Identification_Mark
bctJapanPost Japanese Post 4-State Customer Code Encodes addresses on mail for faster automatic processing in Japan '0'..'9', 'A'..'Z', '-' https://barcodeguide.seagullscientific.com/Content/Symbologies/Japanese_Postal.htm
bctKix Dutch KIX 4-State Customer Code Automatic processing of bulk mail in the Netherlands '0'..'9', 'A'..'Z' up to 18 chars https://barcodeguide.seagullscientific.com/Content/Symbologies/KIX_4_State_Customer_Code.htm
bctKoreaPost Korean Postal Authority Code Automatic sorting of mail in Korea '0'..'9' up to 6 digits https://barcodeguide.seagullscientific.com/Content/Symbologies/Korea_Post.htm
bctPlanet USPS PLANET (Postal Alpha Numeric Encoding Technique) Automatic identification, sorting, and tracking of pieces of mail in the U.S. '0'..'9' up to 38 https://barcodeguide.seagullscientific.com/Content/Symbologies/USPS_PLANET.htm
bctPostNet USPS POSTNET (Postal Numeric Encoding Technique) Sorting of business reply and courtesy reply mail in the U.S. '0'..'9' up to 38 https://en.wikipedia.org/wiki/POSTNET
bctRM4SCC RM4SCC (Royal Mail 4-State Customer Code) Mail service in United Kingdom '0'..'9','A'..'Z' up to 120 https://en.wikipedia.org/wiki/RM4SCC
Tbarcodetelepen.png TBarcodeTelepen bctTelepen Telepen Alpha University and other academic libraries in the UK #0..#127 up to 30 https://en.wikipedia.org/wiki/Telepen
bctTelepenNum Telepen Numeric University and other academic libraries in the UK '0'..'9', 'X'; 'X' must be at even character position. up to 60 https://en.wikipedia.org/wiki/Telepen

Stacked barcodes

Component BarcodeType Name Application Allowed chars Text length Reference
Tbarcodepdf417.png TBarcodePDF417 bctPDF417 PDF417 (Portable Data File) Government-issued identification cards (such as driver's licenses), airline boarding passes, postage stamps, package labels, etc. #0..#255 (ISO-8859-1) up to 1850 alphanumeric, or 2710 numeric characters, or 1108 bytes https://en.wikipedia.org/wiki/PDF417
bctPDF417trunc PDF417 truncated; Compact PDF417 Government-issued identification cards (such as driver's licenses), airline boarding passes, postage stamps, package labels, etc. #0..#255 (ISO-8859-1) up to 1850 alphanumeric, or 2710 numeric characters, or 1108 bytes https://www.neodynamic.com/Products/Help/BarcodeCF2.0/barcodes/CompactPdf417.htm
bctMicroPDF417 MicroPDF417 Designed to encode a moderate amount of data in a very small space #0..#255 (ISO-8859-1) up to 250 alphanumeric or 366 numeric characters https://barcodeguide.seagullscientific.com/Content/Symbologies/MicroPDF417.htm

2D codes

Component Name Application Allowed chars Text length Reference
Tbarcodeaztec.png TBarcodeAztec Aztec Code Transport ticketing (Railroad, Airline). Governmental. #0..#255 interpreted as ISO-8859-1 up to 3823 numeric or 3067 alphabetic characters or 1914 bytes of data http://en.wikipedia.org/wiki/Aztec_Code
Tbarcodeaztecrune.png TBarcodeAztecRune Aztec Rune special '0'..'9' up to 3 (8-bit value 0..255) http://en.wikipedia.org/wiki/Aztec_Code#Encoding
Tbarcodedatamatrix.png TBarcodeDatamatrix Data Matrix Direct part marking UTF-8 up to 2335 alphanumeric characters, 3116 numbers, or 1556 bytes of binary data. https://en.wikipedia.org/wiki/Data_Matrix
Tbarcodeqr.png TBarcodeQR QR Code Advertisement, web links, and many more UTF-8 up to 7089 numeric digits, 4296 alphanumeric characters or 2953 bytes of data https://en.wikipedia.org/wiki/QR_code
Tbarcodemicroqr.png TBarcodeMicroQR Micro QR Code Like QR Code, preferred when less space is available UTF-8 up to 35 http://en.wikipedia.org/wiki/Qr_code#Micro_QR_code
Tbarcodemaxicode.png TBarcodeMaxicode Maxicode Tracking and managing the shipment of packages #0..#255 interpreted as ISO-8859-1 about 90 characters (plus "primary message" needed in property Primary for mode 2 and 3) https://en.wikipedia.org/wiki/MaxiCode

Special properties of some components

Demo application

A demo project is contained in the LazBarcodes installation. It allows to generate barcode from all barcode types supported. Please note that - since the requirements on length and characters changes from type to type - sometimes error messages are displayed; in this case, click on the "Sample text" button to use a predefined sample text for the selected barcode type. A screenshot is displayed at the top of this page.

Final notes

If you need the generation of another barcode and it is present in Zint, please ask for it in the Lazarus forum or mailing lists.


From the Free Pascal wiki, page "LazBarcodes", as it stood on 2023-09-17 after a change by Wp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 3, last changed by WikiArchive .