Free Support Forum -

Code 128A and B

Does anyone know if the barcode library supports Code 128A and 128B? The description only mentioned Code 128 so I'm not quite sure.


Dear vi_tinh,

Thanks for considering Aspose.BarCode.

Aspose.BarCode fully supports the Code 128 barcode standard including Code 128A and Code 128B. The property called Code128CodeSet is used for specifying which code set will be used for creating barcode images.

Code128CodeSet.A ---> creates Code128A barcode images

Code128CodeSet.B ---> creates Code 128B barcode images

Code128CodeSet.C ---> creates Code 128C barcode images.

What's more, if you have no idea about which CodeSet to use for the barcode, you can just use the Code128CodeSet.Auto, which will automatically ditect the codeset from the data you want to be encode to the barcode and output with a shortest encoded image.


LinearBarCode lbc = new LinearBarCode();

lbc.SymbologyType = Aspose.BarCode.Symbology.Code128;
lbc.Code128CodeSet = Aspose.BarCode.Code128CodeSet.Auto;
lbc.CodeText = "1234567890"
lbc.EnableEscape = true;
lbc.CodeLocation = Aspose.BarCode.CodeLocation.Below;
lbc.ImageUnit = System.Drawing.GraphicsUnit.Inch;
lbc.ImageMargins = new Aspose.BarCode.MarginsF(0.05f,0.05f,0.05f,0.05f);

lbc.BorderMargins = new Aspose.BarCode.MarginsF(0.05f,0.05f,0.05f,0.05f);

lbc.Resolution = new Aspose.BarCode.Resolution(300F, 300F, Aspose.BarCode.ResolutionMode.Customized);

lbc.ShowBorder = false;
lbc.xDimension = .015F;
lbc.BarHeight = .5F;
lbc.SaveImageAs(@"C:\Barcode.bmp", System.Drawing.Imaging.ImageFormat.Bmp);