条码组件Spire.Barcode for Java更新至v3.9.3,该版本支持设置条码顶部文本的排列方式,同时也支持在条形码底部添加自定义文本。除此之外,一些在扫描条形码和QR码时出现的问题也得以成功解决,欢迎下载体验。
这么优秀的国产工具怎能错过呢!10月IT行业爆品采购节!全线产品均享85折起,查看优惠价格!想要获取更多福利的朋友咨询在线客服哦~
新功能
-
支持设置条码顶部文本的排列方式。
int width = 399;int height = 159;BarcodeSettings bs = new BarcodeSettings();bs.Type = BarCodeType.UPCA;bs.Unit = GraphicsUnit.Pixel;bs.WideNarrowRatio = 0.5f; bs.TextFont = new Font("Arial", 20, FontStyle.Regular); string data = "602318275035";bs.Data2D = data;bs.Data = data;bs.ShowTextOnBottom = true; bs.TopText = data;bs.ShowTopText = true;bs.TextAlignment = StringAlignment.Center;bs.TopTextAligment = StringAlignment.Center;bs.TopTextFont = new Font("Arial", 20, FontStyle.Regular); bs.AutoResize = false; bs.X = 3.0f; bs.BarHeight = height * 0.6f; bs.ImageWidth = width;bs.ImageHeight = height; BarCodeGenerator generator = new BarCodeGenerator(bs);Image barImage = generator.GenerateImage(); barImage.Save(outputFile_img, ImageFormat.Png);
-
支持在条形码底部添加自定义文本。
BarcodeSettings barsetting = new BarcodeSettings();barsetting.Type=BarCodeType.EAN13;barsetting.BackColor = Color.WhiteSmoke;String data = "6901234567892";barsetting.Data=data;barsetting.Data2D=data;barsetting.TopText="EAN13";barsetting.TopTextFont=new Font("Arial", 20, FontStyle.Regular);barsetting.TopTextColor=Color.Red;barsetting.ShowTopText=true;barsetting.ShowTextOnBottom=true;barsetting.TopTextAligment=StringAlignment.Center;barsetting.BottomText="EAN";barsetting.BottomTextFont=new Font("fangsong", 25, FontStyle.Bold);barsetting.BottomTextColor=Color.Black;barsetting.ShowBottomText=true;barsetting.BottomTextAligment=StringAlignment.Far;BarCodeGenerator generator = new BarCodeGenerator(barsetting);Image barcode = generator.GenerateImage();barcode.Save(outputFile_img);
Bug修复
- 修复了扫描条形码得到的数据不正确的问题。
- 修复了扫描条形码失败的问题。
- 修复了扫描条形码程序抛“NullPointerException”的问题。
- 修复了添加自定义文本不生效的问题。
- 修复了扫描含特殊字符的QR码,得到的数据错误的问题。
推荐阅读
【想要快速完成文档格式转换吗pire系列组件格式转换完整攻略来啦!】
是E-iceblue官方友好合作伙伴,如果您对spire.xls感兴趣,可以联系在线客服了解具体授权价格和使用机制。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!