EASESOFT BARCODCE CONTROL INTRODUCTION
EaseSoft Barcode Control has .Net Windows Form Control for windows application and ASP.NET Web Server Control for web application. .Net Windows Form Control can output barcode to printer or Bitmap Image, ASP.NET Web Server Control can output barcode to Screen or Bitmap Image. EaseSoft Barcode Controls support most barcode symbologies including Code 39, Extended Code 39, Code 128, UCC/EAN-128,Industrial 2 of 5 Planet, Interleaved 2 of 5, Codabar, UPC-A,UPC-E, EAN 13, EAN 8, BOOKLAND,MSI, Code 11, Code 93, PDF417,DataMatrix.
EaseSoft Barcode ASP.NET Web ServerControls use its internal HttpHandler to transfer barcode images directly to the client without any temporary files.It is the most efficient method to generate the barcodes dynamically. EaseSoft Barcode ASP.NET Controls are fully compatible with Microsoft C#.NET, VB.NET, Borland C# Builder and Borland Delphi .NET.
EaseSoft Barcode .Net Windows Form Control can export barcode to any kind of image(BMP,EMF,GIF,JPEG,PNG,TIFF,WMF) which .net framework supports, and can print different barcode images in high quality.
BARCODE PRINTING
Most barcode scanners can scan the width in centimeters of the narrow bars is 0.03 CM which is about .012 inch or 12 mils. You may need to increase the narrow bars value for linear symbology, or PDF417ModuleHeight and PDF417ModuleWidth for PDF417 symbology or DataMatrixModuleSize for Datamatrix symbology if your scanner cannot read barcodes.Most printers’ resolution is over 300 DPI, that means it can print the width of the smallest pixel is about .003 inch. If your printer resolution is less or more than 300 DPI, you need to set the control resolution property to that value.
USE TILDE CODE TO INPUT CONTROL CHARACTERS
- You can input any ASCII character using Tilde code with the format ~ddd, d represents one digit, ddd is the ASCII value of the character. For example, if you enter the text “1234~013~010”, then it will converts to “1234CRLF”, CR is carriage return character and LF is new line character.
- Also you can use the format ~X ( X is any upper case alpha character) to insert control codes (characters with ASCII value 0 to 26). For example, ~@ = NUL, ~A= ASCII 1,~G = BEL (ASCII 7), ~M = ASCII 13 (carriage return).
- You can use ~1 to input FNC1 character ( ASSCII 200)
SYMBOLOGY INTRODUCTION
-
UPC A, UPC E, EAN 8 ,EAN 13 AND BOOKLAND
They only can be encoded numeric data, and you can add 2 digits or 5 digits supplement to the end of the string with separator ‘,’ ,For example, “12345678901,12345”. UPC A must encode 11 digits, UPC E must encode 6 digits, EAN 8 must encode 7 digits, EAN 13 must encode 12 digits, BOOKLAND must encode 9 digits of ISBN number. -
Code 128
Code 128 will automatically analyze the string to choose a better character set to encode the shortest barcode. The FNC definition in code 128 is as following: FNC1 is ASCII 200, FNC2 is ASCII 201, FNC3 is ASCII 202, FNC4 is ASCII 203. -
UCC/EAN-128 input data format:
(AI)XXXX(AI)XXXX, AI is application identifier number, XXXX is data after AI. For example,(11)040901 means production date Sep 01,2004. - Codabar Start and Stop character:
It can be A,B,C or D. If you don’t input one of them to be as your start and stop character, the default value “A” will be added to the encoding string. - Code 11:
Code 11 only can encode numeric data(0 to 9),the dash symbol(-). It is also known as USD-8 -
Code 93:
Code 93 is a continuous, variable-length symbology, it can encode the full ASCII character set. Code 93 is similar to Code 39. It encodes 47 characters.
INSTALL EASESOFT BARCODE CONTROL
EaseSoft Barcode Controls includes two controls: .Net Windows Forms Control (EaseWinControl.dll) and ASP.NET Web Server Control (EaseWebControl.dll).
EaseSoft Barcode Namespace :
EaseSoftBarcode.EaseWebControl: EaseSoft Barcode ASP.NET Web Server Control
EaseSoftBarcode.EaseWinControl: EaseSoft Barcode .Net Windows Forms Control
Barcode Symbology Enumeration : EaseSoftBarcode.Symbology
{
Code39 =0, Code39ASCII =1, Code93=2, UPCA=3, EAN13=4, EAN8=5, UPCE=6, BookLand=7, Code128=8,
UCC128=9, Code25=10, I25=11, Code11=12, Codabar=13, MSI=14, PDF417=20,DataMatrix=21
} ;
Barcode Rotation Enumeration: EaseSoftBarcode.Rotation
{
Clockwise_Zero_Degree=0, Clockwise_90_Degree=1, Clockwise_180_Degree=2, Clockwise_270_Degree=3
};
Barcode Image Format Enumeration: EaseSoftBarcode.ImageType
{
Bmp = 0, Gif = 1, Jpeg = 2, Png = 3
}
Symbology DataMatrix: EaseSoftBarcode.EncodationMode
{
E_AUTO=0, E_ASCII=1,E_C40=2, E_TEXT=3,E_X12=4, E_EDIFACT=5,E_BASE256=6
}
Symbology DataMatrix: EaseSoftBarcode.DataMatrixSize
{
SIZE_AUTO=0,SIZE_12X12=1,SIZE_14X14=2,SIZE_16X16=3,SIZE_18X18=4,SIZE_20X20=5,SIZE_22X22=6,SIZE_24X24=7,
SIZE_26X26=8SIZE_32X32=9,SIZE_36X36=10,SIZE_40X40=11,SIZE_44X44=12,SIZE_48X48=13,SIZE_52X52=14,SIZE_64X64=15,
SIZE_72X72=16,SIZE_80X80=17,SIZE_88X88=18,SIZE_96X96=19,SIZE_104X104=20,SIZE_120X120=21,SIZE_132X132=22,
SIZE_144X144=23,SIZE_8X18=24,SIZE_8X32=25,SIZE_12X26=26,SIZE_12X36=27,SIZE_16X36=28,SIZE_16X48=29
}
Register EaseSoft Windows Form Barcode Control in visual studio.net : 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 . Choose Browse and select the EaseWinControl.dll . Then you can drag and drop it like other windows form control.
Register EaseSoft ASP.NET Barcode Web Server Control in visual studio.net: 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. Choose Browse and select the EaseWebControl.dll . After added the control to the Toolbox, you can use it just like other web control.
Add httpHandlers tag to Web.Config file, The Web.Config file should look like this:
<?xml version=”1.0″ encoding=”utf-8″ ?>
<configuration>
<system.web>
<httpHandlers>
<add verb=”*” path=”ImageService.axd” type=”EaseSoftBarcode.ImageService, EaseWebControl”/>
</httpHandlers
Test ASP.NET Barcode Web Server Control
-
Create a virtual directory in IIS server (for example C:\Inetpub\wwwroot\EaseSoftBarcodeDemo), and copy the EaseWebControl.dll to the sub folder “bin” folder of the directory you created. For example, you can copy EaseWebControl.dll to the folder C:\Inetpub\wwwroot\EaseSoftBarcodeDemo\bin
- Copy Demo1.aspx to C:\Inetpub\wwwroot\EaseSoftBarcodeDemo, then enter http://localhost/EaseSoftBarcodeDemo/Demo1.aspx in your browser.
EASESOFT ASP.NET BARCODE CONTROL PROPERTIES:
- TextToEncode : the data to be encoded for barcode.
- SymbologyID : the barcode type ,default is code 39.
- BackColor: Background color, the default is white.
- ForeColor: Bar color and text color, the default is black.
- Size : Barcode Image Size.
- Height: Image height in pixel, the default is 150.
- Width: Image width in pixel, default is 240.
- AddCheckDigit: Add optional check digit for Code 39, Industrial 2 of 5 and CodaBar, all other symbologies the check digit is mandatory, the default is “Yes”.
- AddCheckDigitToText: Add check digit to human readable text, Code 128 doesn’t add check digit to text, default is “Yes”.
- NarrowBarWidth: Narrow bar width in pixel, the default is 10 mils.
- ShowText: Indicates whether the barcode data should be displayed or not. For Upc-A , Upc-E, Ean 13, Ean 8, BOOKLAND the ShowText is always “Yes”. the default value is “Yes”.
- Font: the font is used for comment and human readable text.
- Ratio: Ratio of the wide bar to the narrow bar, typically this value is between 2 and 3, the default is 3, it only affects Code 39 , Code 39 Full Ascii , Codaba , Code 25 , I25 .
- BarHeight : the height of the barcode , the default is 1 Inch (1000 mils).
- TopMargin: the space of top margin of the bar, the default is 200 mils.
- LeftMargin: the space of left margin of the bar , the default is 0.
- TextMargin: the space of text to bar ,the default is 0 .
- TopComment: the comment on the top.
- BottomComment: the comment on the bottom , the trial version is always set to “Copyright EaseSoft”.
- TopCommentTopMargin: the space of top margin of the topcomment.The default is 0.
- TopcommentLeftMargin: the space of left margin of the topcomment.The default is 0.
- BottomCommentLeftMargin:the space of left margin of the bottomcomment. The default is 0.
- BottomCommentBottomMargin: the space of bottom margin of the bottomcomment. The default is 0.
- Rotation: Rotate the symbology in clockwise.
- Resolution: the bitmap image resolution in DPI for Picture property and printing.
- Visible: for .Net Windows Forms control, default = true
- Picture: the bitmap image of the barcode
PDF417 PROPERTIES:
-
PDFSecurityLevel: The PDF417 SecurityLevel property allows you to select a PDF417 error correction level from 0 to 9 (default = 9 for automatic). PDF417 uses Reed Solomon error correction instead of check digits. This error correction allows the symbol to withstand some damage without causing loss of data. AIM standards recommend a minimum error correction level of 2. The error correction level depends on the amount of data that needs to be encoded, the size, and the amount of symbol damage that could occur.
-
PDFMaxCols: The PDFMaxCols property specifies the maximum number of codeword columns in a PDF symbol. The default value for PDFMaxCols is 0, meaning that program automatically picks the number of columns. It can be set to a value range from 1 to 30.
-
PDFMaxRows: PDFMaxRows properties allow you to set the target number of rows. The default value for PDFMaxRows is 0, meaning that program automatically picks the number of rows. The valid range for this property is 3 to 90.
-
PDFModuleHeight: PDFModuleHeight sets a value for the height of the smallest modules in the PDF417 barcode generated.The recommended value for the Module Height is approximately three times the value for the PDFModuleWidth property. You can set this property to any values greater than 10 mils. The valid range for PDFModuleHeight is between 1 to 100. The default value is 30.
-
PDFModuleWidth: PDFModuleWidth sets a value for the width of the smallest modules in the PDF417 barcodes generated.The recommended value for the Module Width is between 10 and 30 mils. To achieve the best read rate, we recommend that you set to a value which is integral times of the pixels width of the target device (the width of a pixel in the display screen is 13.88 mils and the one in the laser printer is 3.33 mils). The default value is 10.
-
PDFAspectRatio:The PDFAspectRatio determines the overall shape of the PDF417 symbol and is defined as the overall height to width ratio. Higher values for the Aspect Ratio (greater than 1) produce tall, thin PDF417 bar codes and small values (greater than zero and less than 1) produce short, wide bar codes. A value of 1 should produce approximately square bar codes. The default value for this property is 1.
-
PDFTruncatedSymbol:A truncated PDF417 symbol is more area efficient than normal PDF417. By selecting this option, the right hand side of the symbol is removed or “truncated”. This option should only be used in clean environments, since it is less immune to damage.
DataMatrix Properties:
-
EncodationMode: the encoding mode that compresses information in the symbol; Default value is E_AUTO, it will automatically to select the best encoding mode to compress the message.
- E_ASCII: it is used to encode data that mainly contains ASCII characters (0-127). It encodes one alphanumeric or two numeric characters per byte.
- E_C40: it is used to encode data that mainly contains numeric and upper case characters. C40 encodes three alphanumeric data characters into two bytes.
- E_TEXT: it is used to encode data that mainly contains numeric and lowercase characters. TEXT encodes three alphanumeric data characters into two bytes.
- E_BASE256: it is used to encode bytes of data and 8 bit values.
DataMatrixSize: sets the format represented by a number; valid values are from 0 (10X10) to 23 (144X144) and from 24 (8X18) to 29 (16X48); This will be automatically determined if the size of the symbol chosen is too small.
-
DataMatrixModuleSize: DataMatrixModuleSize sets a value for the width of the smallest modules in the DataMatrix barcodes generated.The recommended value is between 10 and 30 mils. To achieve the best read rate, we recommend that you set to a value which is integral times of the pixels width of the target device (the width of a pixel in the display screen is 13.88 mils and the one in the laser printer is 3.33 mils). The default value is 23.
Methods: Export Image To Disk
Picture.Save(“files name”, Image Format)
Image Format can be one of the following:
System.Drawing.Imaging.ImageFormat.Bmp
System.Drawing.Imaging.ImageFormat.Emf
System.Drawing.Imaging.ImageFormat.Gif
System.Drawing.Imaging.ImageFormat.Jpeg
System.Drawing.Imaging.ImageFormat.Png
System.Drawing.Imaging.ImageFormat.Tiff
System.Drawing.Imaging.ImageFormat.Wmf
Example for using EaseSoft Barcode Controls
1. Uses .Net Windows Forms Control with c#
EaseSoftBarcode.EaseWinControl barcode1= new EaseSoftBarcode.EaseWinControl();
barcode1.SymbologyID= EaseSoftBarcode.Symbology.PDF417;
barcode1.TextToEncode=”This is a test for EaseSoft Barcode Control”;
barcode1.Picture.Save( @”c:\test.jpg”, System.Drawing.Imaging.ImageFormat.Jpeg);
2. Uses ASP.NET Web Server Control with c#
Register the server control:<%@ Register TagPrefix=”cc1″ Namespace=”EaseSoftBarcode ” Assembly = “EaseWebControl” %>
Declare the server control and set the control’s property value in the page:<cc1:EaseWebControl id=”EaseWebControl1″ runat=”server” BackColor=”Yellow” Text=”98765432101″></cc1:EaseWebControl>