Html section
<Html xmlns = "http://www.w3.org/1999/xhtml">
Code128Handler
public void ProcessRequest(HttpContext context) { HttpRequest Request = context.Request; HttpResponse Response = context.Response; Response.ClearContent(); Response.ContentType = "image/jpeg"; string barType = Request.QueryString["type"]; string rawData = string.IsNullOrEmpty(Request.QueryString["raw"]) ? ((char)20).ToString() + @"123a" + ((char)18).ToString() + "ab" : Request.QueryString["raw"]; if(string.IsNullOrEmpty(barType)) { barType="C"; } int cw = string.IsNullOrEmpty(Request.QueryString["cw"]) ? 1 : byte.Parse(Request.QueryString["cw"]); int hm = string.IsNullOrEmpty(Request.QueryString["hm"]) ? 1 : byte.Parse(Request.QueryString["hm"]); int vm = string.IsNullOrEmpty(Request.QueryString["vm"]) ? 1 : byte.Parse(Request.QueryString["vm"]); bool showblank = string.IsNullOrEmpty(Request.QueryString["sb"]) ? true : bool.Parse(Request.QueryString["sb"]); bool showfont = string.IsNullOrEmpty(Request.QueryString["fc"]) ? true : bool.Parse(Request.QueryString["fc"]); int emSize = string.IsNullOrEmpty(Request.QueryString["fs"]) ? 16 : int.Parse(Request.QueryString["fs"]); int textA = string.IsNullOrEmpty(Request.QueryString["sf"]) ? 1 : int.Parse(Request.QueryString["sf"]); absCode128 code128; switch(barType) { case "Auto": code128 = new Code128Auto(rawData); break; case "A": code128 = new Code128A(rawData); break; case "B": code128=new Code128B(rawData); break; case "C": code128 = new Code128C(rawData); break; default: code128 = new GS1_128(rawData); break; } code128.BarCellWidth = (byte)cw; code128.HorizontalMulriple = (byte)hm; code128.VerticalMulriple = (byte)vm; code128.ShowBlank = showblank; code128.DataDisplay = showfont; code128.FontSize = emSize; code128.TextAlignment = (System.Drawing.StringAlignment)textA; System.Drawing.Image img = code128.GetBarCodeImage(); img.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg); img.Dispose(); }