Barcode Software - SAP
License Terms (PDF)
Link To TEC-IT
You may receive this kind of error when you call an ASP.NET web page, which contains a TBarCode .NET Web Control or a Barcode Class from the TBarCode .NET Assembly.
The possible reason for this problem is that either the DLLs have not been installed or are not available for the IIS process. It can also be that the 32 Bit version has been installed but the IIS application pool is set to 64 Bit.
The solution would be to install our TBarCode x64 MSI setup and initiate a restart of the IIS service in order to make the IIS process read in the updated PATH variable.
Start an admin console (run as Administrator) and enter
After deploying your web application you get:
The possible reason for this problem is that you added the 32-bit variant of the TBarCode Assembly to your application (typically because Visual Studio development web server runs in 32 bit mode). But your web server is running on a 64 bit system and your application pool is adjusted to not support 32 bit. Now the application wants to load a 64-bit library but it finds the 32 bit version instead, this leads to the incorrect format error.
There are two options for a solution:
When running TBarCode on IIS for Windows behind a firewall, a possible delay of 15-30 seconds may occur when the first page is hit. This is caused by IIS because it is authenticating signed .NET / DLL components.
The solution is to replace all TBarCode DLL files with unsigned versions. These are available on request, please contact the TEC-IT support!
When generating bar codes as image stream, the bars (or spaces) should always be aligned on the pixel grid of the generated bitmap.
Principally, you shouldn't have any problems printing 96 dpi image on a laser printer with 600-1200 dpi. There are some printing tolerance which may occur while converting 96 dpi to 600/1200 dpi but they are minimal.
It might eventually be more complex to adjust the barcode to a specific size or to adjust the printing resolution to 300 dpi or lower. In this case, you should adjust the barcode module width to the dot-width of the printer.
Download Barcode Reference
If you print barcodes from within the browser on thermal label printers, you often encounter quality problems. The bars are not equal in width and not adapted to output resolution. In order to avoid bar width aberrations you have to find a full match of Pixels across 96 dpi browser and 203 dpi printer resolution. For linear bar codes the solution is as follows:
The following ASP.NET C# code shows how to implement this optimization with TBarCode .NET.
double dpi = 203; // printer resolution (8 lines/mm)
int numberOfPixels = 3; // number of pixels for 1 module (= 0.375 mm)
double moduleWidth = numberOfPixels * 25.4 / dpi; // module width in mm
BCControl.Barcode.Dpi = dpi; // 1 bitmap pixel = 1 module
BCControl.Barcode.SizeMode = TECIT.TBarCode.SizeMode.CustomModuleWidth;
BCControl.Barcode.ModuleWidth = (float) (moduleWidth + 0.001);
BCControl.Barcode.AdjustModuleWidthToPixelRaster = true;
BCControl.Width = new Unit(96 * 4, UnitType.Pixel); // always a multiple of 96 !!!
"Server object error 'ASP 0177 : 8002801d' Server.CreateObject Failed (..) - Library not registered"
If you get this error message, you need to change the read permissions of IUSR_MACHINE user account for the type library entry in the registry. Please follow the steps below:
Insert this code into the Page_Load event
Me.BarcodeControl1.Barcode.BarcodeType = BarcodeType.Pdf417
Me.BarcodeControl1.Barcode.Data = data
' TBarCode V7, V8:
Dim horizModules As Integer
Dim verticRows As Integer
horizModules = Me.BarcodeControl1.Barcode.CalculateXColumnsOf2DBarcode()
verticRows = Me.BarcodeControl1.Barcode.CalculateNumberOfRows()
Me.BarcodeControl1.Barcode.SizeMode = SizeMode.FitToBoundingRectangle
' for the dpi use at least 3 times the screen res (or >= 300 dpi)
Me.BarcodeControl1.Barcode.Dpi = 96 * 3
Me.BarcodeControl1.Width = New Unit(horizModules)
' for the height use a multiplier of 3 - 5
Me.BarcodeControl1.Height = New Unit(verticRows * 5)
If you use TBarCode ASP.NET Web Control in a Web Farm you may encounter the following exception:
Exception Type: System.ApplicationException
Message: The requested image is no longer cached.
The TBarCode .NET Web Control uses the HttpContext.Cache object to store the generated barcode image. Since http requests are load balanced within a web farm it can occur that a specific Web Control receives a request for an image, which has been generated on a different application server (and therefore is not available in its local cache).
To overcome this problem you could
Having client affinity enabled all requests are tagged with a cookie so that subsequent requests (from the same client) are routed to the same server in the web farm.
See Application Request Routing (Step 3 – Configure client affinity)
Application Request Routing provides a client affinity feature that maps a client to a content server behind Application Request Routing for the duration of a client session. When this feature is enabled, the load balancing algorithm is applied only for the very first request from the client.
With TBarCode it is possible to stream a barcode image (e.g. based on GET or POST parameters) back to the client.
You can take a look on our online barcode generator, where we do this exactly.
This URL streams a barcode image (Data Matrix with the word "TBarCode" encoded) back to the browser: http://barcode.tec-it.com/barcode.ashx
Please use this code snippet for TBarCode .NET as starting point in ASP.NET:
// first adjust the barcode properties of the myBarcode object (class Barcode)
// then calculate the width and height of the code in Pixels (sample available on request)
// then write the barcode image as stream to the browser as follows
Bitmap image = myBarcode.DrawBitmap(width, height);
Response.ContentType = "image/gif";
The SDK setup contains the Barcode Generator ASP.NET web application (in the samples folder), which is able to stream images to the browser by utilizing the TBarCode .NET Barcode Generator Assembly. This application can be installed on your own web server as well.