Show all |
Hide all
Licensing
Server license:
This is per server license, you may not redistribute Barcode.dll with this license.
This kind of license is valid for one server.
Your company name is embedded in this license.
Product license:
This is per product license, you may redistribute Barcode.dll with your product with this license.
This kind of license is valid for one product (unlimited copies).
Your product name is embedded in this license.
You should use "
License to" field during ordering process to enter your product name.
See Barcode.dll buy page for details on how to buy.
Make sure that the "BarcodeLicense.xml" file is in the run folder of your application (AppDomain.CurrentDomain.BaseDirectory).
Visual Studio 2005
In
Visual Studio 2005 you can add "BarcodeLicense.xml"
file to your project, so it'll be always copied to your output directory:
- Right click on your project in VisualStudio in Solution Explorer.
- Click "Add" then "Existing item..."
- In "Files of type:" combo choose "All Files (*.*)".
- Browse to "BarcodeLicense.xml" file and click "Add" button.
- Right click on "BarcodeLicense.xml" file in Solution Explorer and click "Properties".
- On Properties pane change "Copy to Output Directory" option to "Copy always".
ASP.NET and ASP.NET 2.0 and WebServices
"BarcodeLicense.xml" should be in the root folder of your web application
(the folder with the "web.config" file).
COM object
After obtaining IBaseBarcode interface check its GetLicenseFolder() method.
It returns folder path from which the component will load the license file (BarcodeLicense.xml).
Here is the sample vbs code:
Usually it should be 'c:\Windows\System32' folder.
Visual Studio 2003
In
Visual Studio 2003 you should copy this file manually.
In case of Example1 project this path should be:
- "Example1\bin\Debug" in debug mode
- "Example1\bin\Release" in release mode.
Design time appearance of ASP.NET and WindowsForm controls
Copy "BarcodeLicense.xml" to:
- Visual Studio 2005 - "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE"
- Visual Studio 2003 - "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE"
Do not change this file in anyway.
General
A barcode (also bar code) is a machine-readable representation of information in a visual format on a surface.
Originally barcodes stored data in the widths and spacings of printed parallel lines,
but today they also come in patterns of dots, concentric circles, and hidden in images.
Barcodes can be read by optical scanners called barcode readers or scanned from an image by special software.
Barcodes are widely used to implement Auto ID Data Capture (AIDC) systems
that improve the speed and accuracy of computer data entry.
- Go to Barcode.dll demo page.
- Generate your barcode image
- Print it (File/Print...)
- Scan it with your reader
Note: some scanners need correct checksum to be added to the barcode.
Use 'Add Checksum?' checkbox to add checksum to your barcode on the demo page.
All barcodes on the demo page are rendered as png files with 150dpi resolution.
You may also choose 'Save As..' option, open saved image in Paint and print it.
Paint will use the image resolution (150dpi) so barcode will appear smaller.
Yes, you can.
Yes, you can. Download package contains ASP example.
Yes, you can. Download package contains Crystal Reports example.
Yes, you can. Download package contains Visual Studio Local Reports (RDLC) example.
- Barcode.dll is a .NET 1.1 assembly so it will work on .NET 1.1, .NET 2.0, 3.0 and 3.5
- Barcode.dll was tested against Mono-1.2.5.2.
Programming
If you want to display barcode in user interface use
Windows control
or
ASP.NET control
When you are printing barcode labels, use appropriate barcode class,
as it will be more efficient:
First you have to add reference to Barcode.dll in your project
(see
MSDN How to).
C# code:
VB.NET code:
- Create new ASP.NET project
- Add new web.config file if you don't have one.
- Set up an HttpHandler in an ASP.NET web application -
add the following code to your web.config file, inside the <system.web> section:
<httpHandlers>
<add
verb="*"
path="Barcode.axd"
type="Lesnikowski.Web.BarcodeHttpHandler" />
</httpHandlers>
- If BarcodeControl is not present in the toolbox:
- use the right mouse button on toolbox,
- click 'Choose items...' or 'Add/Remove Items'
- Find 'BarcodeControl' on '.NET Framework Components' tab
or click 'Browse' and point 'Barcode.dll' file
-
Drag and drop BarcodeControl from toolbox to your webpage.
This will add the reference to Barcode.dll to your project.
- Create new WindowsForms project
- If BarcodeControl is not present in the toolbox:
- use the right mouse button on toolbox,
- click 'Choose items...' or 'Add/Remove Items'
- Find 'BarcodeControl' on '.NET Framework Components' tab
or click 'Browse' and point 'Barcode.dll' file
-
Drag and drop BarcodeControl from toolbox to your Windows Form.
This will add the reference to Barcode.dll to your project.
On Windows or ASP.NET controls just use XDpi and YDpi properties.
When generating barcode without controls use following code:
Some scanners may need more free space before and after the barcode.
This section explains how to change this quiet zones programatically.
The lines at the top and the bottom of the barcode are called "bearer bars"
and are used to prevent something called a "short scan."
The bearer bars insure that only complete scans will return a valid read.
ASP 3.0, C++, VB
Create Barcode.asp file with the following content:
Very important... this is the WHOLE code for the page... if you keep the
html tags and doc content it will not work. This way, it outputs and
converts the binary stream of the Rendered barcode and displays it as a gif.
I can now
use it this way:
<img src="Barcode.asp?number=12345" />
from any other page.
Special thanks for the code to Yendi N. Gómez Bouchot.
You can use Barcode.dll from unmanaged code as a COM object:
C++ code:
VB code:
Common problems
If a barcode control is placed on the publically visible page (allow users="*")
which is located in a folder that has (deny users="*") attribute,
barcode image won't be displayed.
This is because, barcode control is using an http handler for generating images.
It allows generating images on the fly without temporary files.
The handler name is Barcode.axd and it needs to be added to the web.config with
(allow users="*") attribute.
Please add the following code to the 'web.config' file into 'configuration' section:
<location path="Barcode.axd">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
If you are getting this error try the following:
-
You need to install version 1.1 of the .NET framework (2.0 and 3.0 versions are not enough).
You can download it here: Framework 1.1
-
If you did not install the component using the windows installer setup,
download windows installer file from download section
and install it (be sure to have 'COM support' option checked).
Other
In case of other problems, feel free to write.
First please provide answers to this questions:
- What language are you using?
- Which Visual Studio version are you using?
- Which .NET Framework version are you using?
- Is it console, windows forms, windows service or web application?
- If it is possible please attach source code of your project (zipped).