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

Free Support Forum - aspose.com

How to create a bar code with the custom size

I would like to create a barcode about 5vm in width, this is the size of the actual barcode, not the image containing the barcode. However, with the following settings:

xDimension= 0.3968
CodeText =CAGE00123456
SymbologyType =Code128
ImageHeight = 12
ImageWidth = 65
BarHeight = 7.6
barCodeBuilder.GraphicsUnit = System.Drawing.GraphicsUnit.Millimeter;

I can only create a barcode about 4.7cm in width, if I change xDimension to 0.397, then the barcode is about 9cm in width. Could you please help me what xDimension I should set to get a barcode about 5 cm in width?


Hi Caifang,

Thank you for your inquiry.

Note that you can use GetCustomSizeBarCodeImage method to manage the overall width of the barcode. Please try to generate the barcode with minimum possible width and then manage the width using custom width support. For more details access the link Generate Barcode Using Custom Width Support.

Hope the above information helps. Feel free to contact us in case of any query and comments.