We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Identyfy barcode and patch code

Hi Team,

We are using the following way to identify Patchcode

using (BarCodeReader reader = new BarCodeReader(FullImageName, BarCodeReadType.PatchCode))

To identify Barcode we are using the following way
Aspose.BarCodeRecognition.BarCodeReader BarcodeReader = new Aspose.BarCodeRecognition.BarCodeReader(FullImageName, Aspose.BarCodeRecognition.BarCodeReadType.Code39Standard);

So it is taking lot of time to complete large IFO file.

Is there any way to identify both(Barcode and Patchcode) in a single line of code?



Hi Anish,

Thank you for contacting support. Well, you can concatenate symbologies while initializing the BarCodeReader object. So you don’t need to initialize second BarCodeReader object. Please have a look over this help topic: Recognizing Multiple Symbologies in Single Image
So it is taking lot of time to complete large IFO file.
In addition to that you can cut the part where bar code resides, if some placement rules are exists for bar code i.e. top right corner. This can significantly speed up the processing as we will have to process only a small portion of the image. Please see an example there: Read Barcode from Specific Region of Image

We hope, this helps. Please feel free to reply us in case of any confusion or questions.

Hi Imran,

We have followed your way to identify patch and barcode but still it took 5 minutes.
We have about 165 images and an IFO file.
Is there any way to improve the performance to a little.
Please find the zipped attachment.
Code we have used is pasted below, Please have a look

private int ReadImageBarcodesWithAspose(ref ACS.PMO.IFOComp.IFOImage image)

if (image.ImageName.ToUpper().IndexOf(“C”) != -1)
return 0;

string FullImageName = image[“ImageName”];
if (FullImageName == null || FullImageName.Trim() == string.Empty)
throw new Exception(“IFO Line With No ImageName Attribute Found.”);
if (!System.IO.File.Exists(FullImageName))
throw new Exception(“Image Not Found At Path '” + FullImageName + “’.”);

int BarCodeCount = 0;


using (BarCodeReader reader = new BarCodeReader(FullImageName, BarCodeReadType.PatchCode | BarCodeReadType.Code39Standard))

while (reader.Read())

string getType = reader.GetReadType().ToString();
// Console.WriteLine("Code Text: " + reader.GetCodeText() + " Type: " + reader.GetReadType());

// PatchCode = reader.GetCodeText();

string bc = reader.GetCodeText().ToString();

if (image[“PatchCode”] == null && !getType.ToUpper().Equals(“CODE39STANDARD”) )
switch (bc.ToUpper())

case “PATCH I”:
case “PATCHI”:
case “PATCH 1”:
case “PATCH1”:
//PatchCode = “PATCH2”;
image[“PatchCode”] = “Patch1”;

case “PATCH II”:
case “PATCHII”:
case “PATCH 2”:
case “PATCH2”:
//PatchCode = “PATCH2”;
image[“PatchCode”] = “Patch2”;

case “PATCH III”:
case “PATCHIII”:
case “PATCH 3”:
case “PATCH3”:
//PatchCode = “PATCH2”;
image[“PatchCode”] = “Patch3”;

case “PATCH IV”:
case “PATCHIV”:
case “PATCH 4”:
case “PATCH4”:
image[“PatchCode”] = “Patch4”;

case “PATCH V”:
case “PATCHV”:
case “PATCH 5”:
case “PATCH5”:
image[“PatchCode”] = “Patch5”;

case “PATCH VI”:
case “PATCHVI”:
case “PATCH 6”:
case “PATCH6”:
image[“PatchCode”] = “Patch6”;


// – we want to check the barcode against the regex
// – if we don’t find a match, throw this barcode away
// – but only do this logic if they have at least one regex defined

IDictionaryEnumerator masks = filters.GetEnumerator();
while (masks.MoveNext())
if (Regex.IsMatch(bc, Convert.ToString(masks.Value), RegexOptions.IgnoreCase)) //f))
image[String.Format(“BarCode{0}”, BarCodeCount)] = bc;
// image[Convert.ToString(masks.Key)] = BarCodeList[i].BarcodeValue;



catch (Exception ex)
throw new Exception(ex.Message);

return BarCodeCount;


Hi Anish,

Thank you for sharing sample graphics. Did you try using the latest version of Aspose.BarCode for 6.3.0? Please share details about the version number. In the exe mode, it does not take more than 1.5 seconds to recognize a single image. Please refer to the download page: