PatchCode Barcodes

Overview

The PatchCode symbology has been developed by Kodak to facilitate task management for automatic multi-page document scanning. Such barcodes do not encode any data; instead, a barcode pattern indicates an action to be performed. Aspose.BarCode for .NET supports six main PatchCode patterns and allows generating barcodes in two modes: as separate barcode images to be placed on a page manually; as a complete A4 or US Letter page with the required resolution. PatchCode barcode labels are printed on four sides of a document; however, it is sufficient to read only one of them to complete scanning. This feature allows reading barcodes successfully even if pages are rotated.

Supported Patterns

Aspose.BarCode for .NET enables generating the main PatchCode set that consists of six patterns. The extended set of patterns introduced by Kodak later on and not standardized yet is not supported by the library. The main pattern set includes the following options: Patch I, Patch II, Patch III, Patch IV, Patch T, and Patch VI.

Sample barcode labels provided below illustrate six basic PatchCode barcode types.

PatchCode Standards

Patch I

Patch II

Patch III

Patch IV

Patch T

Patch VI

The following code snippet explains how to generate PatchCode barcodes using available patterns.

BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.PatchCode, "Patch I");
gen.Parameters.Barcode.CodeTextParameters.FontMode = FontMode.Manual;
gen.Parameters.Barcode.CodeTextParameters.Font.Size.Pixels = 20;
//Patch I
gen.CodeText = "Patch I";
gen.Save($"{path}PatchCodeI.png", BarCodeImageFormat.Png);
//Patch II
gen.CodeText = "Patch II";
gen.Save($"{path}PatchCodeII.png", BarCodeImageFormat.Png);
//Patch III
gen.CodeText = "Patch III";
gen.Save($"{path}PatchCodeIII.png", BarCodeImageFormat.Png);
//Patch IV
gen.CodeText = "Patch IV";
gen.Save($"{path}PatchCodeIV.png", BarCodeImageFormat.Png);
//Patch T
gen.CodeText = "Patch T";
gen.Save($"{path}PatchCodeT.png", BarCodeImageFormat.Png);
//Patch VI
gen.CodeText = "Patch VI";
gen.Save($"{path}PatchCodeVI.png", BarCodeImageFormat.Png);

Generation Modes

Aspose.BarCode for .NET enables different modes of generating PatchCode barcodes: as separate images or as A4 or US Letter pages with portrait or landscape orientation. Moreover, the library allows adding an optional complementary QR Code as a source of supplement information that may be required to process scanning tasks. Setting other barcode types as complementary barcodes is not supported.

Setting Generation Format

To set the format of PatchCode barcodes to be generated, it is necessary to initialize the PatchFormat property of class PatchCodeParameters. This property can take the following values:

  • PatchOnly - basic PatchCode barcode images are generated. This value is used by default.
  • A4 - A4 pages with portrait orientation are outputted having PatchCode barcodes on page borders and an optional QR code in the center.
  • A4_LANDSCAPE - A4 pages with landscape orientation are created with PatchCode barcodes on page borders and an optional QR code in the center.
  • US_Letter - US Letter pages with portrait orientation are generated with PatchCode barcodes set on page borders and an optional QR code in the center.
  • US_Letter_LANDSCAPE - US pages with landscape orientation are created with PatchCode barcodes placed on page borders and an optional QR code in the center.

Adding Complementary QR Code

To add a complementary QR code to a PatchCode barcode page (A4 or US Letter), it is necessary to enter any text value into the ExtraBarcodeText property of class PatchCodeParameters and then set the Location property of class CodeTextParameters to “CodeLocation.None”.

Images below illustrate the PatchCode barcode pages generated with and without adding complementary QR Code labels.

Complementary QR Code

Is Disabled

Is Enabled

The following code snippet explains how to set the required format for a PatchCode barcode to be generated and how to add a complementary QR code.

BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.PatchCode, "Patch I");
//create a PatchCode barcode without complimentary QR
gen.Parameters.Barcode.PatchCode.PatchFormat = PatchFormat.A4;
gen.Save($"{path}PatchCodeA4WithoutQR.png", BarCodeImageFormat.Png);
//create a PatchCode barcode with complimentary QR
gen.Parameters.Barcode.PatchCode.PatchFormat = PatchFormat.A4;
gen.Parameters.Barcode.PatchCode.ExtraBarcodeText = "Aspose page extra info";
gen.Parameters.Barcode.CodeTextParameters.Location = CodeLocation.None;
gen.Save($"{path}PatchCodeA4WithQR.png", BarCodeImageFormat.Png);