![]()
Quick_links...
Search site
Trial products
Online tutorials
Products
Barcodes for Office
Barcode creators
Barcode fonts
Developer tools
Label printing
Labelling tools
Point Of Sale
Resources
New to barcodes?
How To ...
Support centre
Tutorial centre
Which product
For users
Common problems
What's New?
Newsletter
Online registration
Contact us




dBarcode .NET Components are managed code barcode components that allow barcode images to be created within the developer’s own .NET Windows Form or ASP.NET application. A barcode image may be displayed on screen or printed on a printer, and the image may be passed to any other image-handling component.
dBarcode .NET Components are designed to work with Visual Studio.NET 2005/2008/2010 and require the .NET Framework 2.0 (or later) to be installed on any computer using the components. Example code for Windows Forms is provided with each component for users of Visual Basic .NET, C# and J#. An example ASP.NET application is included and may be seen online here.
Design view Sample application with Properties
dialog non-ASCII languages
There are several components in the dBarcode .NET Components family, one for each of the most popular 2D barcode types, and some which handle a wide range of different barcode types. The components are:
To download a TestWare version now
or buy from the online store select the required product below.
All downloads include components for .NET Framework and 2.0
and later. Most currently include a component suitable for use with Visual
Studio 2003 and .NET Framework version 1.1.
or for limited barcode type support:
* These components can also encode Unicode characters.
View the product Help files.
Each dBarcode.NET component is available as a single computer version, or as a developer version which permits royalty-free distribution of the component as part of the developer's own project for up to 10,000 distributions.
Windows
2000/XP/2003/Vista/Windows 7 with Microsoft .NET Framework
Designed for use with Visual Studio.NET 2003/.NET Framework 1.1 and
Visual Studio 2005/2008/2010/.NET Framework 2.0.
Composite and Dual components require .NET Framework version 2.0.
Supports x32, x64 and IA64.
ASP.NET requires Microsoft IIS.
To add a dBarcode Component to the Visual Studio ToolBox, display the ToolBox and select the Components tab. Right click on the Components pane and select Add/Remove Items.. from the pop-up menu displayed. A dialog box is displayed listing the currently installed components. Ensure that the .NET Framework Components page is displayed.
Push the Browse button and navigate to the location where you have installed or copied your dBarcode.NET component and select the DLL (e.g. AbcnetLib.dll).
Then push the Open button.
The list of installed components is now displayed, including your dBarcode.NET component. Ensure that the checkbox alongside the component name is checked. Now push the OK button.
With a project's form open in design mode drag the dBarcode.NET component icon from the toolbox onto the form.
The component icon appears on the panel below the form – it does NOT appear on the form itself. The instance of the component will be given a default name (eg Abcnet1) which appears in the properties panel when the component is selected. A single Form may contain any number of dBarcode.NET Components. The first to be added will be called Abcnet1, the second Abcnet2, and so on; the names may be changed by the user by modifying the Name property within the Properties box.
The properties panel also displays all other settable properties for the component, and these values will be used as defaults unless properties are changed programmatically within your project.
There are many possible approaches to generating barcode images for ASP.NET pages. Whatever method is chosen it is important to ensure that the image is created at a higher graphics resolution than the normal 96 dpi used for web images - because the width of the bars is important.
One method, suitable for use when the barcode is to be data-dependent, is to use two aspx files, one which creates a memorystream barcode image using one of the dBarcode.NET components and then uses a dummy ASP.NET page as the SRC for an IMG tag to display the image at the correct size, eg.
<script language="vb" runat="server">
sub Page_Load(Sender As Object, E As EventArgs)
…………………..
m_barcode.Unit = GraphicsUnit.Inch
m_barcode.XUnit = 0
m_barcode.Font=m_Font
m_barcode.Orientation=0
m_barcode.AutoCheckdigit=TRUE
m_barcode.BarcodeHeight = tht ' desired height in inches
m_barcode.BarcodeWidth = twd ' desired width in inches
m_barcode.CodeTypeValue = 8
m_barcode.caption = Session("xx")
Session("ms")=m_barcode.sBarcode(300,300,System.Drawing.Imaging.ImageFormat.Png)
if Session("ms").Length>0 then
Session("ht")=m_barcode.ImageHeight*96/300 ' adjust size for the desired image
resolution
Session("wd")=m_barcode.ImageWidth*96/300
end if
</script>
</head>
<BODY>
<H1>dLSoft dBarcode.NET - on ASP.NET</H1>
<IMG SRC="page2.aspx" HEIGHT=" <% =Session("ht") %> " WIDTH=" <% =Session("wd")
%> ">
<p> dBarcode.NET components can generate barcode images in BMP, GIF, PNG, JPG,
TIF and WMF formats, and for more than 50 barcode types.
</BODY>
</HTML>
The Session variables ht and wd contain the actual sizes at which the barcode
image is to be drawn on the web page. These are calculated when the page is
loaded and used when the IMG SRC calls the second page.
The second file (page2.aspx) serves up the image at the correct size, eg.
<%@ LANGUAGE="VB"%>
<%
Response.ContentType="image/png"
Response.BinaryWrite(Session("ms").GetBuffer())
%>
A working sample is included with each dBarcode.NET component distribution, and the technique may be seen in operation at our Barcodes Online service.