Overview
The package file is KCG-Barcode.objopackage. It is for Objo Studio desktop projects on Windows, macOS, and Linux. Its complete public API is KCG.Barcode.BarcodeGenerator, KCG.Barcode.BarcodeScanner, KCG.Barcode.BarcodeReadResult, and KCG.Barcode.BarcodeType.
The package identity is com.kcgsoftware.barcode. Objo tracks upgrades by this identity and its metadata version, currently 1.0.3; the distribution filename remains stable.
KCG Barcode is MIT-licensed. The archive also includes the required third-party notices for ZintNET and ZXing.Net. ZintNET and ZXing.Net are open-source and can be found on GitHub for further information.
Install the package
- Start Objo Studio and open the Plugin Manager or package-install command.
- Select
KCG-Barcode.objopackage. - Accept the installation or replacement if an earlier KCG Barcode version is installed.
- Restart Objo Studio, then reopen the project that will use the plugin.
Quick start
Add the package to an Objo desktop project, place an ImageViewer named imgBarcode on a window, then generate a Picture:
Var generator As New KCG.Barcode.BarcodeGenerator
Var picture As Picture = generator.Generate("5901234123457", KCG.Barcode.BarcodeType.EAN13, 3, 1, 0)
imgBarcode.Image = picture
Handle exceptions around generation and saving. A symbol may reject invalid data, lengths, check digits, or option combinations.
Complete API reference
All types are in the KCG.Barcode namespace. The package provides explicit shorter overloads where values can be omitted; it does not rely on optional-parameter metadata. Generation and file writing can raise a RuntimeException in Objo when data, a symbology, or an output path is invalid; handle those calls with Try…Catch.
BarcodeGenerator
Create one generator instance:
Var generator As New KCG.Barcode.BarcodeGenerator
| Call | Return | Purpose |
|---|---|---|
DisplayName(type As BarcodeType) | String | Returns a user-facing name for one generation symbology. |
Generate(data, type), Generate(data, type, scale), Generate(data, type, scale, textPosition), or Generate(data, type, scale, textPosition, rotate90) | Picture | Generates a barcode Picture. The shorter overloads use scale 3, text position 1, and rotation 0. |
GenerateByIndex(data, symbologyIndex), GenerateByIndex(data, symbologyIndex, scale), GenerateByIndex(data, symbologyIndex, scale, textPosition), or GenerateByIndex(data, symbologyIndex, scale, textPosition, rotate90) | Picture | Generates a barcode Picture from the zero-based enum index, 0–78. |
SavePng(data, symbologyIndex, scale, textPosition, outputPath) or SavePng(data, symbologyIndex, scale, textPosition, outputPath, rotate90) | Nothing | Writes a .png file. |
SaveJpeg(data, symbologyIndex, scale, textPosition, outputPath) or SaveJpeg(data, symbologyIndex, scale, textPosition, outputPath, rotate90) | Nothing | Writes a .jpg or .jpeg file. |
SaveBmp(data, symbologyIndex, scale, textPosition, outputPath) or SaveBmp(data, symbologyIndex, scale, textPosition, outputPath, rotate90) | Nothing | Writes a .bmp file. |
SaveGif(data, symbologyIndex, scale, textPosition, outputPath) or SaveGif(data, symbologyIndex, scale, textPosition, outputPath, rotate90) | Nothing | Writes a .gif file. |
SaveTiff(data, symbologyIndex, scale, textPosition, outputPath) or SaveTiff(data, symbologyIndex, scale, textPosition, outputPath, rotate90) | Nothing | Writes a .tif or .tiff file. |
SavePdf(data, symbologyIndex, scale, textPosition, outputPath) or SavePdf(data, symbologyIndex, scale, textPosition, outputPath, rotate90) | Nothing | Writes a .pdf file. |
SaveSvg(data, symbologyIndex, scale, textPosition, outputPath) or SaveSvg(data, symbologyIndex, scale, textPosition, outputPath, rotate90) | Nothing | Writes a .svg file. |
scale must be 1–8 pixels per module. This validation is applied equally by Generate, GenerateByIndex, and every Save… call; values outside that range raise an error instead of creating an invalid image. textPosition is 0 for no label, 1 for below, or 2 for above; labels apply to one-row linear symbols and preserve the supplied data's case. Set rotate90 to 1 for a clockwise 90° rotation, or 0 to leave the image unrotated.
BarcodeScanner and BarcodeReadResult
Create one scanner, then pass it an ordinary Objo Picture:
Var scanner As New KCG.Barcode.BarcodeScannerVar result As KCG.Barcode.BarcodeReadResult = scanner.Read(picture)
| Call or property | Type | Purpose |
|---|---|---|
New KCG.Barcode.BarcodeScanner | BarcodeScanner | Creates a scanner. |
scanner.Read(picture As Picture) | BarcodeReadResult or Nothing | Reads the first supported barcode. It automatically attempts rotation and inversion. |
result.Text | String, read-only | The decoded text. |
result.Format | String, read-only | The detected ZXing format name. |
Var scanner As New KCG.Barcode.BarcodeScanner
Var result As KCG.Barcode.BarcodeReadResult = scanner.Read(picture)
If result <> Nothing Then
MessageBox(result.Format + ": " + result.Text)
Else
MessageBox("No supported barcode was found.")
End If
Use Nothing for the no-result comparison. The scanner reads a Picture; it does not open an image path or use a camera. An application may load a user-selected file into an ImageViewer first, then pass that control's Image to Read().
imgBarcode.LoadFromFile(imagePath) Var result As KCG.Barcode.BarcodeReadResult = scanner.Read(imgBarcode.Image)
BarcodeType
BarcodeType is the 79-value generation enum listed in full below. It is used by Generate and DisplayName. The enum values are also the matching zero-based indexes for GenerateByIndex and every Save… call.
Symbology index
Use these zero-based indexes with GenerateByIndex(). The index order is also the order of BarcodeType.
CodeOne— Code OneCode39— Code 39Code39Extended— Code 39 ExtendedLOGMARS— LOGMARSCode32— Code 32PharmaZentralNummer— PharmazentralnummerPharmacode— PharmacodePharmacode2Track— Pharmacode 2-TrackCode93— Code 93ChannelCode— Channel CodeTelepen— TelepenTelepenNumeric— Telepen NumericCode128— Code 128EAN14— EAN-14SSCC18— SSCC-18Standard2of5— Standard 2 of 5Interleaved2of5— Interleaved 2 of 5Industrial2of5— Industrial 2 of 5IATA2of5— IATA 2 of 5DataLogic2of5— Data Logic 2 of 5ITF14— ITF-14DeutschePostIdentCode— Deutsche Post IdentcodeDeutschePostLeitCode— Deutsche Post LeitcodeCodabar— CodabarMSIPlessey— MSI PlesseyUKPlessey— UK PlesseyCode11— Code 11ISBN— ISBNEAN13— EAN-13EAN8— EAN-8UPCA— UPC-AUPCE— UPC-EDatabarOmni— GS1 DataBar OmnidirectionalDatabarOmniStacked— GS1 DataBar Omnidirectional StackedDatabarStacked— GS1 DataBar StackedDatabarTruncated— GS1 DataBar TruncatedDatabarLimited— GS1 DataBar LimitedDatabarExpanded— GS1 DataBar ExpandedDatabarExpandedStacked— GS1 DataBar Expanded StackedDataMatrix— Data MatrixQRCode— QR CodeMicroQRCode— Micro QR CodeRectangularMicroQRCode— Rectangular Micro QR CodeUPNQR— UPN QRAztec— AztecAztecRunes— Aztec RunesMaxiCode— MaxiCodePDF417— PDF417PDF417Truncated— PDF417 TruncatedMicroPDF417— MicroPDF417AusPostStandard— Australia Post StandardAusPostReplyPaid— Australia Post Reply PaidAusPostRedirect— Australia Post RedirectAusPostRouting— Australia Post RoutingUSPS— USPS Intelligent MailCEPNET— Brazilian CEPNetPOSTNET— POSTNETPLANET— PLANETKoreaPost— Korea PostFIM— FIMRoyalMail4SCC— Royal Mail 4-StateKixCode— Dutch Post KIXDaftCode— DAFTFlattermarken— FlattermarkenJapanPost— Japan PostCodablockF— Codablock-FCode16K— Code 16KDotCode— DotCodeGridMatrix— Grid MatrixCode49— Code 49HanXin— Han XinVINCode— VINRoyalMailMailmark— Royal Mail MailmarkUltracode— UltracodeDPDCode— DPD CodeUPUS10Code— UPU S10Mailmark2D— Royal Mail Mailmark 2DDXFilmEdge— DX Film EdgeBC412— IBM BC412
All readable symbologies
The scanner uses the bundled ZXing.Net reader. The following are the scanner's supported barcode formats; this list is intentionally narrower than the 79 ZintNET generation types.
| ZXing result format | Readable barcode symbology |
|---|---|
CODABAR | Codabar |
CODE_39 | Code 39, including Extended Code 39 data where decodable |
CODE_93 | Code 93 |
CODE_128 | Code 128 and GS1-128 |
EAN_8 | EAN-8 |
EAN_13 | EAN-13 |
UPC_A | UPC-A |
UPC_E | UPC-E |
ITF | Interleaved 2 of 5 and valid ITF-14 |
RSS_14 | GS1 DataBar Omnidirectional / RSS-14 |
RSS_EXPANDED | GS1 DataBar Expanded / RSS Expanded |
QR_CODE | QR Code |
DATA_MATRIX | Data Matrix |
AZTEC | Aztec |
PDF_417 | PDF417 |
MAXICODE | MaxiCode |
Read() returns Nothing. The scanner is not expected to decode the remaining generation types, including Code One, Code 11, Code 16K, Code 49, Micro QR, Rectangular Micro QR, MicroPDF417, postal symbols, Han Xin, Grid Matrix, DotCode, Ultracode, and specialised industrial symbols.Export formats
Each save method regenerates the barcode and writes the chosen file. Every save method is available both with and without its trailing rotate90 argument, and enforces the 1–8 module scale range.
SavePng(..., outputPath, rotate90)for.pngSaveJpeg(..., outputPath, rotate90)for.jpgor.jpegSaveBmp,SaveGif,SaveTiff,SavePdf, andSaveSvgfor their matching extensions
SavePdf only with a .pdf path. UltraCode preview and PNG output preserve its required coloured modules; the other writers use the plugin's greyscale export path.Troubleshooting
Unknown type KCG.Barcode.BarcodeGenerator
The package is not installed, is disabled, or Objo Studio has not been restarted after installation.
The barcode cannot be encoded
Check that the selected symbology accepts the supplied characters and length. EAN/UPC, postal, and GS1 symbols have stricter requirements than general formats such as Code 128 or QR Code.
Visual expectations
The renderer produces high-contrast modules on white and includes a quiet zone. UltraCode uses its required coloured modules, while MaxiCode uses its staggered hexagonal grid and central bullseye finder. Optional human-readable labels for linear symbols preserve the supplied data's case. For reliable scanning, do not crop the quiet zone and test the final printed or exported size with the intended scanner.