Barcode web control that allows to
generate/draw/save barcodes at server and serve it as an
image.
Namespace: Bytescout.BarCodeAssembly: Bytescout.BarCode (in Bytescout.BarCode.dll)
Syntax
Remarks
To use BarcodeWebControl in a web application created without Visual Studio, you need to do two things:
- First, you need to copy the Bytescout.BarCode.dll file to the bin subdirectory of your web application's virtual directory as registered with IIS. If you don't have a separate web application, you can copy it to C:\Inetpub\wwwroot\bin.
- Next, you do need to modify the Web.config file in your
application's virtual directory (or C:\Inetpub\wwwroot\ if you
don't have a separate application), by adding,
inside <system.web> section.
Copy
Code
<httpHandlers> <add verb="*" path="BarcodeHandler.aspx" type="Bytescout.BarCode.BarcodeHandler, Bytescout.BarCode"/> </httpHandlers>
Note that there's no actual file called BarcodeHandler.aspx, but you can reference it within your application as a URL and you don't need to specify any path.
<img src="/BarcodeHandler.aspx?symbology=Code128&value=DATA" />
|
|
For a full list of parameter names see the table below.
To use BarcodeWebControl in a web application created within Visual Studio, you need:
- Add new web.config file if you don't have one.
- Set up an HttpHandler in an ASP.NET web application by adding <httpHandler> section as written above.
- Dag and drop BarcodeWebImage from toolbox to your web page. This will add the references to Bytescout.BarCode.dll to your project. You can fine tune added control appearance by means of Windows Forms designer.
Below is a table of BarcodeHandler.aspx parameters:
| Parameter name | Description | ||||
|---|---|---|---|---|---|
| checksum | true if checksum should be added to barcode; otherwise, false. | ||||
| checksumToCaption | true if checksum should be added to barcode caption; otherwise, false. | ||||
| extraCaption | The additional barcode caption text to draw. | ||||
| extraCaptionFont | The additional barcode caption font. Please use TypeConverter
object for encoding.
|
||||
| extraCaptionPos | The barcode additional caption position. For possible values take a look at CaptionPosition | ||||
| angle | The barcode rotation angle. For possible values take a look at RotationAngle | ||||
| back | The color used to draw the barcode background. Please use
TypeConverter object for encoding.
|
||||
| barHeight | The height of the barcode bars in pixels. | ||||
| captionFont | The barcode caption font. Please use TypeConverter object for
encoding.
|
||||
| captionPos | The barcode caption position. For possible values take a look at CaptionPosition | ||||
| caption | The custom caption text to draw instead of the barcode encoded value. | ||||
| drawCaption | true if to draw the barcode encoded value; otherwise, false. | ||||
| fore | The color used to draw the barcode bars and caption(s). Please
use TypeConverter object for encoding.
|
||||
| margins | The barcode margins. Please use following syntax for encoding: [aLeft;aTop;aRight;aBottom]. | ||||
| narrowBarWidth | The width of the narrow bar in pixels. | ||||
| codabarCheckAlgo | The algorithm to use for Codabar symbology checksum calculation. For possible values take a look at CodabarChecksumAlgorithm | ||||
| codabarStop | The symbol to use as stop symbol in Codabar symbology. For possible values take a look at CodabarSpecialSymbol | ||||
| codabarStart | The symbol to use as start symbol in Codabar symbology. For possible values take a look at CodabarSpecialSymbol | ||||
| code128alphabet | The alphabet to use for Code 128 symbology. For possible values take a look at Code128Alphabet | ||||
| drawGap | true if to draw intercharacter gaps; otherwise, false. Note that not all symbologies support this option. | ||||
| showStartStop | true if to show start and stop symbology symbols in caption text; otherwise, false. Note that not all symbologies support this option. | ||||
| pdf417columnCount | The minimum data column count for PDF417 barcodes. | ||||
| pdf417errorLevel | The error correction level to use for PDF417 barcodes. | ||||
| textHint | The barcode text rendering quality. For possible values take a look at TextRenderingHint | ||||
| smoothing | The barcode rendering quality. For possible values take a look at SmoothingMode | ||||
| symbology | The barcode symbology type. For possible values take a look at SymbologyType | ||||
| value | The barcode value to encode. | ||||
| w2nRatio | The width of a wide bar relative to the narrow bar. | ||||
| halign | The horizontal alignment of the barcode within the container. For possible values take a look at BarcodeHorizontalAlignment | ||||
| valign | The vertical alignment of the barcode within the container. For possible values take a look at BarcodeVerticalAlignment | ||||
| format | The output format of the barcode image. For possible values take a look at ImageFormat | ||||
| width | The width of output image in pixels. | ||||
| height | The height of output image in pixels. | ||||
| key | The key number part of registration information. | ||||
| name | The name part of the registration information. | ||||
Inheritance Hierarchy
System..::.Object
System.Web.UI..::.Control
System.Web.UI.WebControls..::.WebControl
System.Web.UI.WebControls..::.Image
Bytescout.BarCode..::.BarcodeWebImage
System.Web.UI..::.Control
System.Web.UI.WebControls..::.WebControl
System.Web.UI.WebControls..::.Image
Bytescout.BarCode..::.BarcodeWebImage