ASP.NET Barcode Server Control Manual & Tutorial
Easily add barcodes to ASP Dotnet web forms applications with
this bar code control. Our ASP .NET Linear Barcode Server Control supports several barcode symbologies including Code 39, Extended Code 39, Code 128,
UCC/EAN-128,
Interleaved 2 of 5,
LOGMARS, Codabar,
UPC, MSI, EAN, Code 11, Code 93, Industrial 2 of 5 Planet and Postnet.
ASP Server Control
Tutorial
|
Installing our ASP .NET control in your web application is a simple 3 step process:
Step 1 - download and unzip the control package
Download and unzip the package. The DLL file will need to be placed in the
bin project directory for the web application that uses the DLL. For example, an
application named WebApplication1, needs the file to be in
C:\Inetpub\wwwroot\WebApplication1\bin as in the
graphic below:

Step 2 - register the control in your application
After you have extracted the control to application bin folder, you have to
place it in the toolbox.
Registering the Control with an ASP .NET Web Application:
- Open your solution or application and display the form that you want to add the barcode
to. Choose View - Toolbox to display the Toolbox. Right-click on
the Toolbox and choose Customize Toolbox. Choose the .NET Framework
Components folder. Choose Browse and select the server control.

- After the control appears in the Toolbox, it can be added to the web form.
The control cannot be manually sized; this is by design to eliminate scanning
errors and to ensure the dimensions are accurate. To make the barcode wider,
change the X Dimension property from .03 CM to .06 CM. By default, this is
only adjustable in increments of .03CM because the browser is limited to 96
DPI.

- To update the barcode with data use the DataToEncode property in the code
behind window, for example:.
LinearBarcode1.DataToEncode = TextBox1.Text
Step 3 - adjust the properties of the control
After you insert the control in your web application as described in step
2, you may adjust the properties of the control. To do this, you can change
the properties with program code or you
can right-click on the control and choose Properties if it is installed
on a form.
This section explains the main configuration parameters and methods of the control:
NOTE: Many of the barcode sizing parameters are calculated in CM
(centimeters). Some barcode measurements are determined in "mils", which are
1/1000 of an inch. You may use the following rules for your conversions:
- The default of .03CM is equal to about 12
mils (which is read by most scanners) when printed.
- To
convert mils to CM, multiply the mils value by .00254.
For example, 12 mils * .00254 = .03 CM.
- To convert CM to mils, divide the CM value by 2.54. For example, .03 CM /
2.54 = 11.8 mils.
- To convert inches to CM, divide the value in inches by 2.54.
- DataToEncode - this is the data that is to be encoded in the barcode.
- SymbologyID - this is the type of
barcode to be used. The default is code 128. For more information on barcode
types, visit
our barcoding for beginners site.
- BarHeightCM - the height of the barcode in CM. Default is 1 CM.
- leftMarginCM - the space of the left margin in CM.
- XDimensionCM - width in centimeters of the narrow bars. The default is 0.03 CM which is about
.012" or 12 mils. You may need to increase this value if your scanner
cannot read barcodes with small X dimensions. If you have a high
quality laser or CCD scanner, you may decrease this value to obtain a
higher density barcode.
- ApplyTilde - in Code 128 auto, if set to "true", you can use the
format ~ddd to specify the ASCII code of the character to be encoded. Default is
off. For example, if you enter the following text in the Data field: ~029NET
you will actually be encoding GSNET Where GS is a delimiter ASCII
29 character. Other commonly used ASCII codes are ~009 for
a tab and ~013 which is a return function. This property is only valid for Code
128 Auto.
- AddCheckDigit - automatically adds the check digit to the barcode.
The check digit is required for all symbologies except Code 39, Industrial 2
of 5 and Codabar. When using symbologies that do not require the check digit,
you may disable the check digit.
- AddCheckDigitToText - automatically adds the check digit that is
encoded in the barcode to the human readable text that is displayed.
- CodabarStartCharacter - the start character for CODABAR.
Valid values are "A", "B", "C" or "D".
- CodabarStopCharacter - the stop character for CODABAR.
Valid values are "A", "B", "C" or "D".
- Code128CharSet - the set of characters to be used in code128. Valid values are: AUTO,
A, B or C.
The default is AUTO. For more information on Code 128, review
our Code 128 FAQ.
- BackColor - the background color of the barcode.
- ForeColor - the color of the foreground text and bars in the barcode.
- Rotation - indicates the orientation of the barcode. Valid values are 0
(normal), 90 (vertical),180 (inverted)
and 270 (inverted vertical).
- ShowText - if this value is yes or true, the human readable text will
be displayed with the barcode.
- TextMarginCM - the distance between the lower portion of the barcode
and the text.
- TopMarginCM - the top margin in CM.
- Wide2NarrowRatio - this is the wide to narrow ratio of symbologies
that only contain narrow and wide bars such as Code 39, Interleaved 2 of 5 and
MSI. Usually, this value is between 2 and 3. The default value is 2.
- UPCESystem - the encoding system to be used for UPC-E,
valid values are 0 and 1.
Symbology Specific
Notes
UPC-A, UPC-E, EAN-8 and EAN-13
Enter the data to be encoded without any spaces or dashes. You can enter the
+2 and +5 add-on codes by just adding them to the end of the string. If the
check digit is added, it will be ignored and regenerated to ensure that the code
can be scanned. If you rotate the barcode by 270, you may need to increase the
top margin. For UPC-E, you must enter the full 11 or 12 digit UPC-A code and the
barcode will be compressed if possible.
POSTNET and PLANET
When using the POSTNET barcode, the XDimensionCM (Narrow Bar Width) of .05 CM should be used.
For barcodes to be acceptable to the US post offices, they must be between 22
and 24 bars per inch. Setting the XDimensionCM to .05 should produce about 23
bars per inch. You should adjust this setting for your printer if your results
are different.
Code 128
The "AUTO" setting for Code 128 will automatically switch character
sets in the barcode as necessary. Our implementation of Code 128 auto has
many options as described below:
- Encoding functions such as tabs and returns in Code128:
If ApplyTilde is set to "true", you can use the format ~ddd to specify the
ASCII code of the character to be encoded. For example,
Code~009Bar~013 will create a barcode that encodes
Code<Tab Function>Bar<Return
Function>. For other functions,
refer to the ASCII
chart.
- Encoding UCC/EAN-128:
To encode alpha-numeric UCC/EAN-128, the character set is set to "AUTO"
for automatic. Then, ASCII 202 or character Ê is entered as the FNC1 before
each AI and the required start C is also included. For example, the UCC number
of (8100)712345(21)12WH5678 should be entered as: Ê8100712345Ê2112WH5678.
In most cases the AIs will be properly represented in the human readable text.
If the parenthesis is not around the correct number for the AI, enter the
following extended ASCII character as the FNC1 for the correct number of
digits in your AI:
ASCII 212 = 2 digits
ASCII 213 = 3 digits
ASCII 214 = 4 digits
ASCII 215 = 5 digits
For example, to encode (1277)56, you would enter Ö127756.
- For more information about this, please refer to the
UCC/EAN
128 section of our Code 128 FAQ or visit the
UCC website.
Subscribe to our FREE
IDAutomation.com newsletter to
receive updates on new products and symbologies available from us as
well as industry news related to bar-coding. We respect the privacy
of our visitors. |
Technical Notes and
Support
The barcode images generated are high quality JPEG images that should display
in all web browsers. The files that are generated are stored in the TEMP
directory by default. Therefore, you may have to grant ASPNet_USR rights to that
directory. To go to the TEMP directory, Choose File - Run on your server and
type %TEMP% in the Open dialog and choose OK. Although the files are small, an
administrator should delete them every month or so to free space on the server.
To obtain technical support for this product, please visit the
ASP.NET Technical Support Site.
You may also view our
product index to obtain a list of all products we offer.
Copyright © 2002 IDAutomation.com, Inc. All rights reserved. All trademarks
mentioned are the property of their respective owners.