Difference between revisions of "LazBarcodes"
(Codes 3-of-9) |
(→Components: Merge common rows in Components table) |
||
Line 67: | Line 67: | ||
=== Components === | === Components === | ||
{| class="wikitable" | {| class="wikitable" | ||
− | ! Component || BarcodeType || Name || Application|| Allowed chars || Text length || Reference | + | ! Component || BarcodeType || Name || Application || Allowed chars || Text length || Reference |
|--- | |--- | ||
| <tt>TBarcodeC11</tt><br />[[Image:tbarcodec11.png]] || || Code-11 || Telecommunication || <tt>'0'..'9', '-'</tt> || up to 121 || [https://en.wikipedia.org/wiki/Code_11 https://en.wikipedia.org/wiki/Code_11 ] | | <tt>TBarcodeC11</tt><br />[[Image:tbarcodec11.png]] || || Code-11 || Telecommunication || <tt>'0'..'9', '-'</tt> || up to 121 || [https://en.wikipedia.org/wiki/Code_11 https://en.wikipedia.org/wiki/Code_11 ] | ||
|--- | |--- | ||
− | | <tt>TBarcodeC128</tt><br />[[Image:tbarcodec128.png]] || <tt>bctC128</tt> || Code-128 || Industrial applications || <tt>#0..#127</tt> || up to 160 || [https://en.wikipedia.org/wiki/Code_128 https://en.wikipedia.org/wiki/Code_128] | + | | rowspan="2" | <tt>TBarcodeC128</tt><br />[[Image:tbarcodec128.png]] || <tt>bctC128</tt> || Code-128 || Industrial applications || <tt>#0..#127</tt> || up to 160 || [https://en.wikipedia.org/wiki/Code_128 https://en.wikipedia.org/wiki/Code_128] |
|--- | |--- | ||
− | + | | <tt>bctEAN128</tt> || EAN-128, or <br> GS1-128 || Industrial applications || <tt>#0..#127 || Depending on "Application identifier" <br>to be given in square parenthesis || [https://en.wikipedia.org/wiki/GS1-128 https://en.wikipedia.org/wiki/GS1-128]] | |
|--- | |--- | ||
− | | <tt>TBarcode2of5</tt><br>[[Image:tbarcode2of5.png]] || <tt>bctCode25Standard</tt> || Standard 2-of-5, or <br>Matrix 2-of-5 || Warehouse sorting<br>photo finishing<br>airline ticket marking || <tt>'0'..'9'</tt> || up to 80 || [https://en.wikipedia.org/wiki/Matrix_2_of_5 https://en.wikipedia.org/wiki/Matrix_2_of_5] | + | | rowspan="6" | <tt>TBarcode2of5</tt><br>[[Image:tbarcode2of5.png]] || <tt>bctCode25Standard</tt> || Standard 2-of-5, or <br>Matrix 2-of-5 || Warehouse sorting<br>photo finishing<br>airline ticket marking || <tt>'0'..'9'</tt> || up to 80 || [https://en.wikipedia.org/wiki/Matrix_2_of_5 https://en.wikipedia.org/wiki/Matrix_2_of_5] |
|--- | |--- | ||
− | + | | <tt>bctCode25DataLogic</tt> || DataLogic 2-of-5 || Processing and sorting of mail <br>for the Chinese Postal Service || <tt>'0'..'9'</tt> ||up to 80 || [https://en.wikipedia.org/wiki/Matrix_2_of_5 https://en.wikipedia.org/wiki/Matrix_2_of_5] | |
|-- | |-- | ||
− | + | | <tt>bctCode25IATA</tt> || IATA 2-of-5 || Airline Cargo || <tt>'0'..'9'</tt> || up to 45 || [https://en.wikipedia.org/wiki/Industrial_2_of_5#IATA_2_of_5 https://en.wikipedia.org/wiki/Industrial_2_of_5#IATA_2_of_5] | |
|--- | |--- | ||
− | + | | <tt>bctCode25Industrial</tt> || Industrial 2-of-5 || Cardboard printing<br>photo developing envelopes<br>warehouse sorting systems || <tt>'0'..'9'</tt> || up to 45 || [https://en.wikipedia.org/wiki/Industrial_2_of_5 https://en.wikipedia.org/wiki/Industrial_2_of_5] | |
|--- | |--- | ||
− | + | | <tt>bctCode25Interleaved</tt> || Interleaved 2-of-5 || 135 film<br>cartons of some products</tt> || <tt>'0'..'9'</tt> || up to 89 || [https://en.wikipedia.org/wiki/Interleaved_2_of_5 https://en.wikipedia.org/wiki/Interleaved_2_of_5] | |
|--- | |--- | ||
− | + | | <tt>bctITF14</tt> || ITF-14 || Packaging levels of a product || <tt>'0'..'9'</tt> || up to 13 || [https://en.wikipedia.org/wiki/ITF-14 https://en.wikipedia.org/wiki/ITF-14] | |
|--- | |--- | ||
− | | <tt>TBarcode3of9</tt><br>[[Image:tbarcode3of9.png]] || <tt>bctCode39<br>bctLOGMARS</tt></tt> || Code 3-of-9 (C39)<br>LOGMARS || Name badges, inventory and<br>industrial applications <br> LOGMARS: different bar widths|| <tt>'0'..'9', 'A'..'Z', ' ', <br>'–', '.', '$', '/', '+', '%'</tt> || up to 74 || [https://en.wikipedia.org/wiki/Code_39 https://en.wikipedia.org/wiki/Code_39] | + | | rowspan="3" | <tt>TBarcode3of9</tt><br>[[Image:tbarcode3of9.png]] || <tt>bctCode39<br>bctLOGMARS</tt></tt> || Code 3-of-9 (C39)<br>LOGMARS || Name badges, inventory and<br>industrial applications <br> LOGMARS: different bar widths|| <tt>'0'..'9', 'A'..'Z', ' ', <br>'–', '.', '$', '/', '+', '%'</tt> || up to 74 || [https://en.wikipedia.org/wiki/Code_39 https://en.wikipedia.org/wiki/Code_39] |
|--- | |--- | ||
− | + | | <tt>bctCode39Ext || Extended Code 3-of-9<br>(C39ext) || Name badges, inventory and<br>industrial applications || <tt>#0..#127</tt> || up to 74 || [https://en.wikipedia.org/wiki/Code_39#Full_ASCII_Code_39 https://en.wikipedia.org/wiki/Code_39#Full_ASCII_Code_39] | |
|--- | |--- | ||
− | + | | <tt>bctCode93 || Code-93 || Canada post || like C39 || Up to 107 || [https://en.wikipedia.org/wiki/Code_93 https://en.wikipedia.org/wiki/Code_93] | |
|} | |} | ||
Revision as of 23:11, 11 March 2022
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:
- 1D barcodes: Code-11, Code-128, Channel code, EAN-128, several 2-of-5 variants, several 3-of-9 variants, EAN, UPC, Plessey, MSI/Plessey, Telepen, medical/pharmaceutical codes (CodaBar, Code-32, Pharma one-track, Pharma two-track, PZN), postal codes (Australian post, Japanese post, Korean Post, Deutsche Post IdentCode and LeitCode, Dutch KIX, Planet, PostNet, Royal Mail RM4SCC)
- 2D barcodes: QR, MicroQR, Aztec, Aztec Rune, Data Matrix, PDF417
Author
2011 - Jose Mejuto
License
BSD 3 as it is being inherited from the zint source code.
Dependencies / System Requirements
- None
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
- v2.0.0: Added a lot of 1D barcodes
- v1.0.3: Internally used units renamed to avoid naming conflict with CodeTyphon package PL_APE.
- v1.0.2: Change of license from GPL to BSD
- Initial development.
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
- Text: TCaption - Text to be encoded as a barcode. Note that, depending on the barcode type, there exist limitations on allowed text length and allowed characters.
- ShowHumanReadableText: Boolean - Displays the encoded text underneath the barcode symbol. Note that the encoding algorithm may add check sum or additional characters to the input text.
- BarcodeType - Some barcode components can be modified to create various symbologies by selecting the corresponding value in this (type-dependent) enumeration.
- Scale: Integer - Horizontal scaling factor of the barcode determining the width of the smallest feature (bar or space) in pixels. Scale=0 tries to select an internal scale value such that the barcode fills the control's width as much as possible. Note that this scaling factor applies to all bars and spaces and therefore, increasing Scale does not increase the barcode with gradually but by more or less large steps.
- SymbolHeight: Integer - Similar to Scale, but refers now to the vertical direction. Again, SymbolHeight=0 fills adjusts the internal symbol height to fill the height
- MinSymbolHeight: Integer - Prevents the symbol to become too small.
- RecommendedSymbolSize: Boolean - If true, overrides the Scale and SymbolHeight settings so that the size of the symbol is as close as possible to its specification.
- AutoSize: Boolean - inherited standard property. When true, Width and Height are selected such that the current size of the barcode is enclosed. Note that AutoSize=true is ignored when Scale=0 or SymbolHeight=0.
- Margin: Integer - Amount of empty pixels added around the symbol
- WhitespaceWidth: Integer - Amount of empty pixels added to the left and right of some symbologies to enhance readability of barcode scanners.
- BearerBarMode: TBearerBarMode = (bbmNone, bbmBearerBars, bbmBox) - adds horizontal bars above and below the barcode (bbmBearerBars) or a box around the barcode (bbmBox). The thickness of the bars and the box border is given by the Margin multiplied by the currently used internal Scale parameter.
- ForegroundColor: TColor - Color used to draw the bars
- BackgroundColor: TColor - Color used to draw the background of the barcode (spaces, margin and text area).
Methods
- CopyToClipboard - Copies the barcode to the clipboard as a bitmap
- SaveToFile(const AFileName: String; AImageClass: TFPImageBitmapClass) - Saves the barcode as a graphic image of the specified class to file.
- SaveToStream(const AStream: TStream; AImageClass: TFPImageBitmapClass) - Saves the barcode as a graphic image of the specified class to a stream.
- SaveToEPSFile(const AFileName: String) - Saves the barcode as EPS file
- SaveToEPSStream(const AStream: TStream) - Saves the barcode in EPS format as stream.
- SaveToSVGFile(const AFileName: String) - Saves the barcode in SVG format to file
- SaveToSVGStream(const AStream: TStream) - Saves the barcode in SVG format to as stream
- ErrorString: String - In case of an error, this read-only property contains a message why the Text could not be encoded correctly.
Components
Component | BarcodeType | Name | Application | Allowed chars | Text length | Reference |
---|---|---|---|---|---|---|
TBarcodeC11 |
Code-11 | Telecommunication | '0'..'9', '-' | up to 121 | https://en.wikipedia.org/wiki/Code_11 | |
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] | |
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 |
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 |
TLazBarcodeC11
1D barcodes
- TBarcodeC11:
- Code-11: max 121 numeric characters ('0'..'9')
- TBarcodeC128: Property BarcodeType allows to select one of the subsets:
- bctC128: Code-128 - max 160 text characters (ASCII)
- bctEAN128: UPC/EAN-128, also known as GS1-128] - variable length depending on "Application Identifier" to be given in square brackets.
- TBarcode2of5: Property BarcodeType allows to select one of the following subsets:
- bctCode25Standard: Standard 2-of-5, also known as Matrix 2-of-5 - up to 80 numerical digits
- bctCode25DataLogic: DataLogic 2-of-5 - up to 80 numerical digits
- bctCode25IATA: IATA_2_of_5 - up to 45 numerical digits
- bctCode25Industrial: Industrial 2-of-5 - up to 45 numerical digits
- bctCode25Interleaved: Interleaved 2-of-5 - up to 89 numerical digits
- bctITF14: ITF-14 - up to 13 numerical digits
- TBarcode3of9: supports the following subsets via property BarcodeType:
- bctCode39: Code 3-of-9 (C39) - up to 74 characters: numeric, uppercase-alpha and some special characters (-. $/+%abcd).
- bctCode39Ext: Extended Code 3-of-9 (C39+) - up to 74 characters, all ASCII characters allowed (< #128).
- bctLOGMARS: LOGMARS - like C39, different wide bar width.
- bctCode93: Code-93 - up to 107 characters like C39.
- TBarcodeEAN: supports the following subsets via property BarcodeType:
- bctEAN: EAN-8 and EAN-13 - up to 13 numeric digits
- bctEAN14: EAN-14 - up to 13 numeric digits
- bctISBN: ISBN - 9, 10 or 13 numeric characters or 'X'
- bctNVE18: NVE-18 - up to 25 numeric digits
- bctUPCA: UPC-A - up to 10 numeric digits (plus 2 check digits)
- bctUPCE: UPC-E - up to 7 numeric digits
2D barcodes
- TLazBarcodeQR: QR Code
- TLazBarcodeMicroQR: MicroQR
- TLazBarcodeAztec: Aztec Code
- TLazBarcodeAztecRun: Aztec Rune
- TLazBarcodeDataMatrix: DataMatrix
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.
Screenshot
Author
2011 - Jose Mejuto
License
BSD 3 as it is being inherited from the zint source code.
Download
The latest source code can be found on Lazarus-CCR
Change Log
- v2.0.0: Added a lot of 1D barcodes
- v1.0.3: Internally used units renamed to avoid naming conflict with CodeTyphon package PL_APE.
- v1.0.2: Change of license from GPL to BSD
- Initial development.
Dependencies / System Requirements
- None
Status: In development
Issues: None by now.
Installation
- Step 1: Compile the package "lazbarcodes_runtimeonly".
- Step 2: Install the package "lazbarcodes".
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.