bulb Barcode.dll faq

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 a single server.
Your company name is embedded in this license.

Product license:

This is per product license, you may redistribute Barcode.dll with your product.
This kind of license is valid for one product (unlimited number of copies of a single application).
Your product name is embedded in this license.
You should use "License to" field during ordering process to enter your product name.

Ultimate license:

This license allows you to redistribute Barcode.dll as a part of your own software
(unlimited number of different applications / unlimited number of servers)

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, 2008

In Visual Studio 2005, 2008 you can add "BarcodeLicense.xml" file to your project, so it'll be always copied to your output directory:
  1. Right click on your project in VisualStudio in Solution Explorer.
  2. Click "Add" then "Existing item..."
  3. In "Files of type:" combo choose "All Files (*.*)".
  4. Browse to "BarcodeLicense.xml" file and click "Add" button.
  5. Right click on "BarcodeLicense.xml" file in Solution Explorer and click "Properties".
  6. 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 BarcodeFactory 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' or 'c:\WINNT\System32' folder.

Classic ASP 3.0

After obtaining BarcodeFactory check its GetLicenseFolder method. It returns folder path from which the component will load the license file (BarcodeLicense.xml).
Here is the sample asp code: Usually it should be 'c:\Windows\System32' or 'c:\WINNT\System32' folder. Restarting IIS server might be required.

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.

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 2008 - "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE"
  • 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.
  1. Go to Barcode.dll demo page.
  2. Generate your barcode image
  3. Print it (File/Print...)
  4. 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.

To see all barcode symbologies that Barcode.dll supports visit Barcode.dll symbologies page.

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.
Yes, you can. It is very simmilar to using Visual Studio Local Reports (RDLC). However you might need some additional SQL Server Reporting Services configuration.

  • 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.
Yes, you can. Download package contains Gizmox Visual WebGui samples in VB.NET and C#.

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:

  1. Create new ASP.NET project
  2. Add new web.config file if you don't have one.
  3. Set up an HttpHandler in an ASP.NET web application - add the following code to your web.config file, inside the <system.web> section: If you are using VS2003 use the following:
  4. 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
  5. Drag and drop BarcodeControl from toolbox to your webpage. This will add the reference to Barcode.dll to your project.
  1. Create new WindowsForms project
  2. 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
  3. 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.

In 2008 version of the Reporting Services you need to add additional privileges to the code using Barcode.dll.

For preview mode you need to edit the following file:

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\
RSPreviewPolicy.config
For a deployed report you need to edit the following file:
C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\
rssrvpolicy.config

Find the CodeGroup with the Report_Expressions_Default_Permissions name:

Now change the:

PermissionSetName="Execution"
to:
PermissionSetName="FullTrust"

If you already own the license put the license file (BarcodelLicense.xml) in appropriate folders: In preview mode license file is loaded from:

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\
When deployed license file is loaded from:
C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\

In case of preview you just need to run the report again. In the output window you shouldn't see any SecurityExceptions (A first chance exception of type 'System.Security.SecurityException' occurred in mscorlib.dll)

In case of deployed report please remember to restart ReportServer ("SQL Server Reporting Services (MSSQLSERVER)") service.

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:

If you are getting this error try the following:
  1. 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
  2. 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).

Products > Barcode.dll - barcode component for .NET > Barcode.dll faq