Space between barcode bars

Is there any way to reduce white space width between the bars. I want to create very compact bar code.

Hi Martin,


Thank you for contacting support. You can control the white space width between the bars by setting X-Dimension property. Please refer to the following example topic: Manage X Dimension and Y Dimension

Please do let us know in case of any confusion or questions.

Hi

When using RM4SCC format, I was trying to create a barcode with compact widht, it appears for this type of barcode, width can not be controlled by xDimension.

Aspose.BarCode.BarCodeBuilder barCode;
barCode = new Aspose.BarCode.BarCodeBuilder();
barCode.AutoSize = false;
barCode.CodeLocation = Aspose.BarCode.CodeLocation.None;
barCode.xDimension = 0.1F;
barCode.ImageWidth = 43F;
barCode.ImageHeight = 10F;
barCode.CodeText = “123456789012345678”;
barCode.SymbologyType = Aspose.BarCode.Symbology.RM4SCC;


string path1 = System.Configuration.ConfigurationManager.AppSettings[“FilePath”];
barCode.Save(path1, ImageFormat.Bmp);

Hi Martin,


Thank you for sharing the details. Please note that the X-Dimension is the narrowest bar or space in the barcode. It is not controlling over all barcode width. The barcode size depends upon the code text as well. There are also some encoding modes. Anyway, you can adjust a specific barcode size by following the example topic here: Generate Barcode Using Custom Width Support

The getOnlyBarCodeImage method will return you the minimum possible size and then you can use getCustomSizeBarCodeImage method to adjust its size. Please don’t truncate its original width or height otherwise you could face recognition failure problems.

I hope, It helps. Please do let me know in case of any confusion or questions.