Buy Now Download Free Trial
HAVE QUESTIONS OR NEED HELP? SUBMIT THE SUPPORT REQUEST FORM or write us at SUPPORT@BYTESCOUT.COM
Barcode web control that allows to generate/draw/save barcodes at server and serve it as an image.
Namespace:  Bytescout.BarCode
Assembly:  Bytescout.BarCode (in Bytescout.BarCode.dll)

Syntax

Visual Basic (Declaration)
<ComVisibleAttribute(False)> _
Public Class BarcodeWebImage _
        Inherits Image _
        Implements IBarcode, IBarCodeContainer
C#
[ComVisibleAttribute(false)]
public class BarcodeWebImage : Image, 
        IBarcode, IBarCodeContainer
Visual C++
[ComVisibleAttribute(false)]
public ref class BarcodeWebImage : public Image, 
        IBarcode, IBarCodeContainer
JavaScript
Bytescout.BarCode.BarcodeWebImage = function();

Type.createClass(
        'Bytescout.BarCode.BarcodeWebImage',
        Image,
        Bytescout.BarCode.IBarcode,
        Bytescout.BarCode.IBarCodeContainer);

Remarks

To use BarcodeWebControl in a web application created without Visual Studio, you need to do two things:

  1. 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.
  2. 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,
      Copy Code
                <httpHandlers>
                    <add verb="*" path="BarcodeHandler.aspx" type="Bytescout.BarCode.BarcodeHandler, Bytescout.BarCode"/>
                </httpHandlers>
                
    
    inside <system.web> section.

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.

  Copy Code
            <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:

  1. Add new web.config file if you don't have one.
  2. Set up an HttpHandler in an ASP.NET web application by adding <httpHandler> section as written above.
  3. 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.
  Copy Code
TypeConverter tc = TypeDescriptor.GetConverter(typeof(Font)); tc.ConvertToString(aFont);
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.
  Copy Code
TypeConverter tc = TypeDescriptor.GetConverter(typeof(Color)); tc.ConvertToString(aBackColor);
barHeight The height of the barcode bars in pixels.
captionFont The barcode caption font. Please use TypeConverter object for encoding.
  Copy Code
TypeConverter tc = TypeDescriptor.GetConverter(typeof(Font)); tc.ConvertToString(aFont);
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.
  Copy Code
TypeConverter tc = TypeDescriptor.GetConverter(typeof(Color)); tc.ConvertToString(aForeColor);
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.
pdf417minColumnCount The minimum data column count for PDF417 barcodes.
pdf417columnCount The exact data column count for PDF417 barcodes.
pdf417rowCount The exact data row count for PDF417 barcodes.
pdf417compaction The compaction mode to use while creating barcodes of PDF417 family. For possible values take a look at PDF417CompactionMode
pdf417errorLevel The error correction level to use for PDF417 barcodes. For possible values take a look at PDF417ErrorCorrectionLevel
pdf417CreateMacro Whether to create PDF417 barcode as part of Macro PDF417 sequence.
pdf417FileID File ID value for Macro PDF417 barcodes. Should be in range [0..899]
pdf417SegmentIndex Segment Index value for current Macro PDF417 barcode. Should be in range [0..99998]
pdf417LastSegment Whether current Macro PDF 417 barcode should be marked as last segment of sequence
pdf417UseManualSize Whether PDF417 barcodes should use manual row and column count settings instead of automatically calculated values (and the only option to set a minimal column count).
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.
dmcompaction The compaction mode to use while creating Data Matrix barcodes. For possible values take a look at DataMatrixCompactionMode
dmsize The symbol size for Data Matrix barcodes. For possible values take a look at DataMatrixSize
qrversion The minimum symbol version (size) for QR Code barcodes. Value should be in [0..40] range.
qrhint The hint to use when encoding non-alphanumeric data while creating QR Code barcodes. For possible values take a look at QREncodeHint
qrerrorLevel The error correction level for QR Code barcodes. For possible values take a look at QRErrorCorrectionLevel
isbnAutoCaption true if auto created additional caption for ISBN barcodes should be drawn; otherwise, false.
aztecerrorLevel The error correction level for Aztec Code barcodes. For possible values take a look at AztecErrorCorrectionLevel
aztecSize The minimum symbol size for Aztec Code barcodes. Value should be in [0..36] range.
supplementSpace The space (in pixels) between main and supplemental barcode.
drawCaption2D true if to draw the barcode encoded value for 2D barcodes; otherwise, false.
quietZones true if quite zones should be drawn when drawing symbologies that have such zones; otherwise, false.
preserveMinReadableSize true if output size should be checked so it's not less than barcode size; otherwise, false.
autoFit true if the barcode should auto fit into control size; otherwise, false.

Inheritance Hierarchy

System..::.Object
  System.Web.UI..::.Control
    System.Web.UI.WebControls..::.WebControl
      System.Web.UI.WebControls..::.Image
        Bytescout.BarCode..::.BarcodeWebImage

See Also