CODE 128 是 Computer Identics Corporation (USA) 于 1981 年开发的条形码。CODE 128 可以表示所有 128 个 ASCII 码字符(数字、大写/小写字母、符 和控制码)。由于它可以表示所有可以与计算机键盘一起使用的字符(除了日文汉字、平假名和片假名),它是一种计算机友好的条形码。Code-128 由于数据的“双密度压缩”,可以非常紧凑,当两个数字写入一个条形码模数时。
Code-128 条码包含 107 个字符,其中 103 个是数据字符,3 个起始字符和 1 个终止字符。要对所有 128 个 ASCII 字符进行编码,有三组 Code128 条码字符 – A、B 和 C,可在单个条码中使用。
- 128 A – ASCII 格式的字符,从 00 到 95(数字从“0”到“9”,字母从“A”到“Z”)和特殊字符
- 128 B – ASCII 格式的字符,从 32 到 127(数字从“0”到“9”,字母从“A”到“Z”,从“a”到“z”),以及特殊字符
- 128 C – 从 00 到 99 的 ASCII 字符(仅用于数字代码)
Code-128 条码符 系统、符 系统指示器、数据字符编码、大小、解码算法、应用参数、前缀字符串和符 系统标识符的技术要求在全球范围内由 ISO/IEC 15417: 2007 “信息技术 – 自动识别和数据采集技术 – Code 128 条码符 规范”。
从FastReport .NET中的代码创建条形码
// Create a report object Report report = new Report(); // Create a report page ReportPage page = new ReportPage(); // add a unique identifier page.CreateUniqueName(); //Add it to the collection of report pages report.Pages.Add(page); // Create a data band DataBand dataBand = new DataBand(); //with a unique identifier dataBand.CreateUniqueName(); //and add it to the band collection page.Bands.Add(dataBand); //Create a barcode object FastReport.Barcode.BarcodeObject barcode = new FastReport.Barcode.BarcodeObject(); //Set the barcode type barcode.Barcode = new FastReport.Barcode.Barcode128(); //Set a numeric combination for encoding barcode.Text = "(02)14611234567890(37)24"; //Place the barcode on the page barcode.Parent = dataBand; //Set the size of the object barcode.Bounds = new RectangleF(0, 0, Units.Centimeters * 10, Units.Centimeters * 3); //Display the report report.Show();
从FastReport VCL中的代码创建条形码
{ Add the "Data" page } DataPage := TfrxDataPage.Create(frxReport1); { Add a page } Page := TfrxReportPage.Create(frxReport1); { Create a unique name } Page.CreateUniqueName; { Set the default margins, paper sizes and orientation } Page.SetDefaults; { Change the orientation of the paper } Page.Orientation := poLandscape; { Add report title } Band := TfrxReportTitle.Create(Page); Band.CreateUniqueName; { For a band, it is enough to set the Top coordinate and height } { Both coordinates are in pixels } Band.Top := 20; Band.Height := 40; { Create a barcode object } Barcode := TfrxBarcodeView.Create(Band); { Set the barcode type } Barcode.BarType := bcGS1Code128; { Set a numeric combination for encoding } Barcode.Text := '(02)14611234567890(37)24'; { Set the position and size of the object } Barcode.Top := 0; Barcode.Left := 10; Barcode.Height := 40; { Set the display of the text at the bottom of the barcode } Barcode.ShowText := True; { Display the report } frxReport1.ShowReport; end;
现在,您应该了解了如何使用Fastreport创建Code-128 条形码了
相关产品
- 表生成器FastReport .NET是适用于.NET Core 3,ASP.NET,MVC和Windows窗体的全功能 告库。使用FastReport .NET,您可以创建独立于应用程序的.NET 告。
- FastReport VCL是用于在软件中集成商务智能的现代解决方案。它提供了可视化模板设计器,可以访问最受欢迎的数据源, 告引擎,预览,将过滤器导出为30多种格式,并可以部署到云,Web,电子邮件和打印中。
FastReport 技术交流群:702295239 欢迎一起进群讨论
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!