Barcode Component — sgcHTML | eSeGeCe

Barcode

TsgcHTMLComponent_Barcode — render a pure-Pascal Code 128 SVG barcode from any ASCII text, with optional human-readable caption, in Delphi, C++ Builder and .NET.

TsgcHTMLComponent_Barcode

Set Data (and optionally Symbology), then read the HTML property.

Component class

TsgcHTMLComponent_Barcode

Renders

Inline SVG Code 128 barcode + optional text (pure-Pascal encoder)

Languages

Delphi, C++ Builder, .NET

Set the payload, render it

Set Data, pick ModuleWidth/Height, then read HTML.

uses
  sgcHTML_Component_Barcode;

var
  oBarcode: TsgcHTMLComponent_Barcode;
begin
  oBarcode := TsgcHTMLComponent_Barcode.Create(nil);
  try
    oBarcode.Data := 'ACME-00219841';
    oBarcode.Symbology := bsCode128;
    oBarcode.ModuleWidth := 2;
    oBarcode.Height := 60;
    oBarcode.ShowText := True;

    WebModule.Response := oBarcode.HTML;   // SVG bars + human-readable text
  finally
    oBarcode.Free;
  end;
end;
// includes: sgcHTML_Component_Barcode.hpp

TsgcHTMLComponent_Barcode *oBarcode = new TsgcHTMLComponent_Barcode(NULL);
try
{
  oBarcode->Data = "ACME-00219841";
  oBarcode->Symbology = bsCode128;
  oBarcode->ModuleWidth = 2;
  oBarcode->Height = 60;
  oBarcode->ShowText = true;

  String html = oBarcode->HTML;   // SVG bars + human-readable text
}
__finally
{
  delete oBarcode;
}
using esegece.sgcWebSockets;

var barcode = new TsgcHTMLComponent_Barcode();
barcode.Data = "ACME-00219841";
barcode.Symbology = TsgcHTMLBarcodeSymbology.bsCode128;
barcode.ModuleWidth = 2;
barcode.Height = 60;
barcode.ShowText = true;

string html = barcode.HTML;   // SVG bars + human-readable text

Key properties & methods

The members you reach for most often.

Payload

Data is the value to encode; only ASCII 0–127 is accepted (an out-of-range character raises an exception).

Symbology

Symbology selects the barcode standard; Code 128 (bsCode128) ships today, auto-switching between subsets A/B/C for the most compact encoding.

Bar sizing

ModuleWidth sets the pixel width of the narrowest bar; Height sets the bar height.

Human-readable text

ShowText prints the encoded Data under the bars.

Colours

Color paints the bars and text; BackgroundColor fills behind them.

Rendering

GetSVG (also used by HTML) returns the inline SVG markup, wrapped in a sgc-barcode container.

Keep exploring

Online HelpFull API reference and usage guide for this component.
All sgcHTML ComponentsBrowse the full feature matrix of 80+ components.
Download Free TrialThe 30-day trial ships the 60.HTML demo projects.
PricingSingle, Team and Site licenses with full source code.
Best value: All-AccessEvery eSeGeCe product, Premium Support included, from €1,059/year.
See All-Access pricing

Ready to Get Started?

Download the free trial and start building web UIs in Delphi, C++ Builder and .NET.