GetHTML2 Method

Generates the HTML tags to represent the barcode.


object.GetHTML2 moduleWidth, height, shortBarHeight, style



The Barcode Active Server Component


Numeric value indicating the width of a barcode module in pixels. The width of a barcode module is the same as that of the thinnest bar. So this is effectively a scale factor for scaling the barcode; 1 will be no scaling (minimum width is used), 2 twice the minimum width, etc. The "minimum width" does not guarantee the printed barcode to be scannable, depdending on the printer resolution. The maximum value is 2 (limited by the static images shipped with this component).


Numeric value indicating the height of the barcode in screen pixels.


Numeric value indicating the height of the short bars of the barcode in screen pixels. If the barcode type supports only a single barcode height, this must be the same as the height parameter.


Numeric value. Must be 0 currently.

Return Value

A string composed of a sequence of tags rendering the barcode.


This method generates a sequence of <IMG> tags that have as image SRC a subset of the images named: b1.gif, b2.gif thru b10.gif, and w1.gif, w2.gif thru w10.gif, and bs1.gif thru bs4.gif. The names are hard-coded. You must copy these image files to the directory of the ASP file using this Barcode Active Server component.

The moduleWidth is a scale factor for rendering the barcode and is typically 1 or 2. Depending on the barcode type used, if the user's printer does not have high enough resolution, a value of 2 or above needs to be used.

For most barcode types, the shortBarHeight parameter is the same as the height parameter. For barcode types EAN-8, EAN-13, UPC-A and UPC-E, you may OPTIONALLY supply a smaller value for shortBarHeight; this, however, is only cosmetic and has no effect on the actual scannability of the barcode. For POSTNET, short bars MUST be shorter than than the regular bars. However, you can still supply the same value for shortBarHeight as for height in this case, because the Barcode Active Server Component will automatically calculate and use a different value internally.