I’m wanting to encode with strictly hex characters.
Ex: 40 0a 1e 0d
Also, Should the characters be padded or can it be entered 400a1e0d?
I’m wanting to encode with strictly hex characters.
Ex: 40 0a 1e 0d
Also, Should the characters be padded or can it be entered 400a1e0d?
See the document on how to generate PDF417 Barcode Family for your complete reference.
I also used the following sample code and it works fine:
e.g.
Sample code:
var hexStr = "400a1e0d";
var byteArray = Enumerable.Range(0, hexStr.Length / 2).Select(x => Convert.ToByte(hexStr.Substring(x * 2, 2), 16)).ToArray();
var byteArrayAsString = new String(byteArray.Select(b => (char)b).ToArray());
Aspose.BarCode.Generation.BarcodeGenerator gen = new Aspose.BarCode.Generation.BarcodeGenerator(Aspose.BarCode.Generation.EncodeTypes.Pdf417, byteArrayAsString);
//set encode mode to Binary
gen.Parameters.Barcode.Pdf417.Pdf417CompactionMode = Aspose.BarCode.Generation.Pdf417CompactionMode.Binary;
gen.Save("e:\\test2\\Pdf417.png", Aspose.BarCode.Generation.BarCodeImageFormat.Png);
//attempt to recognize
BarCodeReader read = new BarCodeReader(gen.GenerateBarCodeImage(), DecodeType.Pdf417);
foreach (BarCodeResult result in read.ReadBarCodes())
Console.WriteLine(result.CodeText);
what part of the project do I add that code to
l
.
The first three lines converts the hex chars to byte array string. The rest of code is just creating the barcode based on byte array string using Aspose.BarCode for .NET API. The last lines read the barcode text. So, you may accommodate and write your own code by yourselves accordingly for your requirements.