Spire.Barcode is a professional barcode library specially designed for .NET developers (C#, VB.NET, ASP.NET, .NET Core) and Java developers (J2SE and J2EE) to generate, read and scan 1D & 2D barcodes.

Fri Jul 01, 2016 3:01 pm

Hello all.

Im using this in a program and i must say...very good.
However i need help with an issue.

Looking at the attachment i uploaded, we can see the actual barcode is really long/height.
Im trying to remove alot of the height but using the code I see on the forums doesnt affect the height of the barcode SPECIFICALLY.
Rather it distorts the entire label.
Pasting my code below, grateful for any assistance.

P.S im using BarCodeType.Code128, is there a smaller one?
Code: Select all
            BarcodeSettings setting = new BarcodeSettings();
            BarcodeSettings.ApplyKey("key here");
           
          //  setting.Data =  id;
          //  setting.Type = BarCodeType.Code128;
            setting.X = 0.8f;
            setting.Unit = GraphicsUnit.Millimeter;

            //set the width of barcode
            setting.BarHeight = 10;

            setting.HasBorder = true;
            setting.BorderWidth = 0.5F;

            setting.Data = id;
           // setting.Data2D = "545863";
            //generate EAN-Code 128
            setting.Type = BarCodeType.Code128;

kemnet
 
Posts: 5
Joined: Mon Aug 17, 2015 5:19 pm

Mon Jul 04, 2016 2:36 am

Hi,

Sorry for late reply as weekend.
Please change the setting.BarHeight number to smaller one, like this:
Code: Select all
setting.BarHeight = 5;

This will change the barcode height not effect on toptext, if there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.BarCode