|
IDAutomation.com, Inc. |
||||||||
|
Your Source for Quality Symbology |
||||||||
|
||||||||
|
|
| Home: Products: Barcode Components: ASP .NET Barcode Web Component Advantage: Manual & Tutorial |
INDEX:
If a scanner is needed to verify barcodes, consider IDAutomation's hand-held USB Barcode Scanners.
Once installed, the server control may be easily utilized in an ASP.NET Web Solution and used like any other control in the Visual Studio development toolbox. In addition to ease of use, this method also allows the resolution to be changed, which may be necessary when printing barcodes at very precise X dimensions or if it is necessary to print to low-resolution thermal printers. The server control displays images in the web solution and browser from automatically generated temp files, which are deleted from the server after a specified amount of time. Permanent files in many formats may also be created for specific needs.
The following tutorial illustrates the installation process with the Linear Server Control. When using other Server Controls, the difference in file names must be considered accordingly.

NOTE Certain IIS configurations on operating systems including Windows Vista and Windows Server 2003 require the IDAutomation.LinearServerControl.dll to be placed in the global assembly cache (GAC). On most systems, the GAC is located at C:\windows\assembly. For more information on this issue, please see the article Using the IDAutomation.com Server Controls on Windows Vista.


Sizing the Server Control:
The control cannot be sized manually because it must meet specific requirements such as a precise X dimensions (narrow bar width) and barcode heights specified in the properties of the control. To increase the width, increase the X dimensionCM property. To increase the height, increase the bar height property. Because the control defaults to a 96 DPI image (which is the resolution of the web browser), the X dimension can only be adjusted in increments of .03cm or 12mils. To allow other settings such as .045 CM, the image ImageResolution must be increased to 203 or 300.
Using the Control as a DLL to Create Graphic Files on the Server:
IDAutomation's server control uses the .NET framework to perform image conversions, therefore a barcode image may be created in any format that .NET supports. The Visual Studio .NET C# example below creates the control in memory for this purpose, without placing it on a form:
{
//Create an instance of the Linear barcode server control
IDAutomation.LinearServerControl.LinearBarcode MyBarCode = new IDAutomation.LinearServerControl.LinearBarcode();
//Set the symbology
MyBarCode.SymbologyID = IDAutomation.LinearServerControl.LinearBarcode.Symbologies.Code39;
//Set the DataToEncode
MyBarCode.DataToEncode = "123456789012";
//Save the image. The first parameter is the full path and file name of the image. The @ sign preceding the parameter allows
//the slash characters in the file name. The second parameter is the type of file to save; specify .bmp, gif, .jpeg, .png, etc.
MyBarCode.SaveImageAs(@"C:\Temp\Images\Test39.jpg", System.Drawing.Imaging.ImageFormat.Jpeg
}
| Properties and Methods |
| IDAutomation recommends using default values for all properties, unless requirements dictate otherwise. This section explains the main configuration properties and methods of the server control. The "Parameters" column specifies the parameters used in Streaming Mode. Parameters used in the Java Barcode Package, Dynamic Barcode Generator Service and the Barcode Server for IIS are also compatible with this product. All true and false parameter values should be specified as "T" or "F" and all parameters are uppercase. |
| Property Name | Default | Description |
| ApplyTilde | False | When ApplyTilde is True in Code 128 with the Auto character set, the format ~??? may be used to specify the ASCII code of the character to be encoded and several other tilde options are enabled. For example, the data of "Web~009Component" would encode "Web <TAB> Component". |
| BarHeightCM | 1 | The height of the barcode in centimeters (CM). |
| BearerBarHorizontal | 0 | The width of the horizontal bearer bars as a multiple of the XDimension; valid options are 0-10. |
| BearerBarVertical | 0 | The width of the vertical bearer bars as a multiple of the XDimension; valid options are 0-10. |
| CaptionAbove | Null | When text appears in this property, it is displayed in the margin above the symbol. |
| CaptionBelow | Null | When text appears in this property, it is displayed in the margin below the symbol. |
| CharacterGrouping | 0 | Determines the number of characters between spaces in the text interpretation of the data encoded in the barcode. Supported values are 0 (which disables grouping), 3, 4 and 5. |
| CheckCharacter | True | When True, automatically adds the check digit. 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, the check digit may be disabled. |
| CheckCharacterInText | False | When True, automatically adds the check digit that is encoded in the barcode to the human readable text that is displayed. |
| Code128CharSet | Auto | The set of characters to be used in Code128. Valid values are: Auto, A, B or C. |
| DataToEncode | 123456789012 | The data that is to be encoded in the barcode symbol. To update the barcode with data, use the code-behind window. For example: ServerControlBarcode1.DataToEncode = TextBox1.Text |
| FitControlToBarcode | True | Automatically sizes the control canvas and generated image. In streaming mode, the parameters H and W may be used to specify the height and width in pixels. |
| Font | Sans Serif 10 Points |
Used to change the font or font point size of the text interpretation or human readable text. In VB, this property may be changed in code, for example: BarCode1.Font.Size = 10 BarCode1.Font.Name = "Times New Roman" |
| ImageAutoDelete | True | If set to True, automatically deletes image files after the amount of minutes specified in ImageTimeToLive. |
| ImageConcurrentDeletions | 10 | The number of files that may be concurrently deleted by a single user session. A new user session is required to delete existing images that have been created after ImageTimeToLive expires. |
| ImageFileName | na | A read-only method that returns the name of the current file in the IDAutomation sub folder. |
| ImageTimeToLive | 10 | The number in minutes to keep generated images on the server. |
| ImageResolution | 96 | The resolution of the image measured in dots per inch (DPI). This should be changed to 203 when using 203 dpi thermal barcode printers. |
| ImageType | GIF | The type of image to be created; JPEG, GIF and PNG are supported. |
| LeftMargin | 0.2 | The space of the left margin in centimeters. |
| NarrowToWideRatio | 2.0 | The narrow to wide ratio of symbologies that only contain narrow and wide bars such as Code 39, Interleaved 2 of 5 and MSI. Common values are 2, 2.5 and 3. |
| Rotation | Zero_Degrees | Orientation indicates the orientation of the barcode. Valid values are 0, 90, 180 and 270. |
| ShowText | Yes | If ShowText is Yes or True, the human readable text will be displayed with the barcode. |
| ShowTextLocation | Below | Determines if the human-readable text is placed above or below the barcode. |
| StreamImage | False | Set this property to True if the barcode image should be streamed to the browser. This property is no longer supported in this component and is provided for backwards compatibility only. Streaming functionality is now only provided in the ASP Barcode Server for IIS. |
| SymbologyID | Code128 | Selects the symbology or barcode type. To obtain more information about barcode types, visit the bar-coding for beginners site. |
| TextMarginCM | 0.10 | Sets the distance between the symbol and the text in centimeters. |
| TopMarginCM | 0.2 | The top margin in centimeters. |
| WhiteBarIncrease* | 0 | A percentage value to increase the white space between the bars to improve readability. Common values are 10, 15, 20 and 25. * |
| XDimensionCM | 0.03 | The width in centimeters of the narrow bars. The X dimension should be increased if the barcode scanner being used does not dependably decode the symbol. The X dimension may only be adjusted in increments of .03cm (12mils) unless the ImageResolution is increased. |
| XDimensionMILS | 11.8 | The width in mils (1/1000 of an inch) of the narrow bars. The X dimension should be increased if the barcode scanner being used does not dependably decode the symbol. |
| Advanced Server Control Properties and Methods | ||
| IDAutomation recommends using default values for all properties, unless requirements dictate otherwise. | ||
| Name | Default | Description |
| AllowCustomPaths | False | By default all of the
images are created in the IDAutomation subdirectory of the directory where
the page is being served. When set to true, custom paths may be used for
the generated image files. For example: LinearBarcode1.AllowCustomPaths = true; LinearBarcode1.ImageLocalPath=@"C:\Inetpub\wwwroot\WebApplication\Images\Barcode"; LinearBarcode1.ImageRelativePath=@"Images/Barcode"; Note: "WebApplication" is the virtual directory used in the above code. |
| ImageLocalPath | IDAutomation | The local path used to save images. The ASPNET user must have Read, Modify and Write rights in this directory. Additionally, this directory must reside below the virtual directory. |
| ImageRelativePath | IDAutomation | The Image Relative Path to the generated images. The relative path is based off the virtual directory of the website. If it is necessary to use a slash for the relative path, make sure it is the forward slash ( / ). This will allow the control to work properly on all web browsers. |
| SaveImageAs (filename, format) | This method allows the
barcode object to be saved in image file formats, which include JPEG, GIF
and PNG. It also allows for conversion to any image type that the framework
supports. For example: Barcode1.SaveImageAs(@"C:\Temp\Images\bar-code-image.gif", System.Drawing.Imaging.ImageFormat.Gif) |
|
| PDF417 Specific Properties: | ||
| IDAutomation recommends using default values for all properties, unless requirements dictate otherwise. For a complete list of properties, see the PDF417 API. | ||
| Name | Default | Description |
| ApplyTilde | True | When set to True, the format ~??? may be used to specify the ASCII code of the character to be encoded. Commonly used ASCII codes are ~009 which is a tab function and ~013 which is a return function. |
| PDFErrorCorrectionLevel | 0 | The Reed Solomon error correction level encoded in the symbol. More error correction creates a larger symbol that can withstand more damage. The default setting of 0 performs automatic selection. |
| MacroPDFEnable | False | When true, indicates that this barcode is part of a MacroPDF sequence. |
| MacroPDFFileID | 0 | Assigns a file id to the MacroPDF barcode. Each barcode in the MacroPDF sequence must have the same file id assigned to it. Valid options are 0-899. |
| MacroPDFSegmentIndex | False | The index number of each MacroPDF symbol must have a unique segment index, starting at zero and incrementing thereafter by one. |
| MacroPDFLastSegment | 0 | When set to True, indicates that this is the final barcode in the MacroPDF sequence. |
| PDFColumns | 0 | The number of data columns in the PDF417 barcode. When this is left at zero "0," the control will automatically adjust this parameter internally. |
| PDFMode | Binary | The mode of compaction used to encode data in the symbol. When set to "Text," a smaller symbol may be created. Text mode encodes all characters on the U.S. keyboard plus returns and tabs. |
| PDFRows | 0 | Sets the number of rows. It is recommended to leave this property at 0, the default. |
| Truncated | 0 | A truncated PDF417 symbol is more area efficient than normal PDF417. When true, the right hand side of the PDF417 is removed or truncated. |
| XtoYRatio | 3 | The X multiple height of individual cells; default = 3, usually 2 to 4 times the NarrowBarCM (X). |
| Data Matrix Specific Properties: | ||
| IDAutomation recommends using default values for all properties, unless requirements dictate otherwise. For a complete list of properties, see the DataMatrix API. | ||
| Name | Default | Description |
| ApplyTilde | True | When set to True the tilde (~) will be processed as explained in the DataMatrix FAQ and the format ~d??? may be used to specify the ASCII code of the character to be encoded. For example, "ECC200~d009Code128" encodes "ECC200 <TAB> Code128." |
| EncodingMode | E_BASE256 (3) | Valid Encoding Mode values are E_ASCII, E_C40, E_TEXT and E_BASE256. |
| PreferredFormat | Auto | Sets the preferred format; valid selections are from (10X10) to (144X144) and from (8X18) to (16X48); the default value of "Auto" is recommended. If the component needs more space to create the symbol, this selection will be ignored. |
| XDimensionCM | 0.06 | The width in centimeters of the squares that make up the symbol. This value may need to be increased if the scanner cannot read symbols with small X dimensions. When working with a high quality 2D imager, this value may be decreased to create a smaller symbol. |
| MaxiCode Specific Properties: | ||
| IDAutomation recommends using default values for all properties, unless requirements dictate otherwise. For a complete list of properties, see the MaxiCode API. | ||
| Name | Default | Description |
| ApplyTilde | True | When set to True, the format ~ddd may be used to specify the ASCII code of the character to be encoded as explained in the Maxicode FAQ. A setting of "False" will disable ApplyTilde. |
| Country | na | A 3-digit number representing the country code. Proper implementation for UPS and other transportation applications will automatically override this field. |
| EncodingMode | Mode2 | The mode of compression and encoding used in the symbol. Modes 2 and 3 are designed for use in the transport industry. Mode 4 encodes up to 93 characters or 138 digits. Mode 5 encodes up to 77 characters and provides more error correction capabilities than mode 4. Mode 6 indicates that the symbol encodes a message used to program a reader system (scanner). |
| ServiceClass | na | A 3 digit number representing the service code. Proper implementation for UPS and other transportation applications will automatically override this field. |
| ZipCode | na | The postal code; mode 2 uses a 9-digit numeric postal code and mode 3 uses a 6 character alphanumeric postal code. Proper implementation for UPS and other transportation applications will automatically override this field. |
| Aztec Specific Properties: | ||
| IDAutomation recommends using default values for all properties, unless requirements dictate otherwise. For a complete list of properties, see the Aztec API. | ||
| Name | Default | Description |
| ApplyTilde | False | When set to True, the format ~d??? may be used to specify the ASCII code of the character to be encoded. Commonly used ASCII codes are ~d009 which is a tab function and ~d013 which is a return function. |
| MessageAppend | na | Specifies the message appended across multiple symbols. Only valid if NumberOfSymbols is greater than 1. |
| NumberOfSymbols | 1 | Invokes MessageAppend across # symbols. |
| XDimensionCM | 0.06cm | The width in centimeters of the squares that make up the symbol. This value may need to be increased if the scanner cannot read symbols with small X dimensions. When working with a high quality 2D imager, this value may be decreased to create a smaller symbol. |
|
Technical Issues and Support |
Free product support may be obtained by reviewing articles that are documented at the ASP.NET Support Site and by searching resolved public help desk issues. Priority phone, e-mail and help desk support is provided up to 30 days after purchase. Additional priority phone, e-mail and help desk support may be obtained if a Priority Support and Upgrade Subscription is active.
Common Issues and Solutions:
|
Image Resolution |
The default resolution of the generated images is 96 DPI, which allows the image to be displayed properly in the web browser. At times, it may be necessary to increase the resolution of the image for printing purposes. This can be easily accomplished by changing the ImageResolution property.
|
|
|
Product Quick Links: [Barcode Fonts | Font Tools | Components | Label Software | Scanners | Printers | RFID | Product Index] |
© Copyright 2000-2007 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.
|
Over 70% of Fortune 100 companies use IDAutomation's products to automate their businesses. |