ASP Barcode Script

John Avis by | July 31, 2007 | Classic ASP Web Development

Display and print Code 39 barcodes from ASP

This sub-routine will produce a barcode from any alphanumeric string. The barcode is be made of a table with individual black and white images making up the individual lines. It can also be printed from the browser.

Add the script below to your own ASP script, or create an include file for it. You need a couple of image files to ensure that the barcode will display and print correctly. These are just 1px by 1px white and black 'GIF' files and you can download them below.

To call the barcode sub-routine use the following syntax (where data is the text or numbers in the barcode, height is the height in pixels (defaults to 30), width is the width in pixels (either 1 or 2 works well, default is 1), and text is a boolean value for whether you want the barcode data printed below the barcode:

Barcode data, height, width, text
Sample ASP Barcode

Download barcode.zip (1.24kb)

Related Posts

Computers & Internet Web Development Website Hosting

500 Internal Server Error after migrating from IIS 7.5 to IIS 10

by John Avis | November 4, 2019

As support ends for Microsoft Windows Server 2008 I have recently gone through migrating some websites to a new server running Windows Server 2016 and IIS 10 but some of the websites did not work.


Jquery/Javascript Web Development

tagInput: A simple jQuery plugin for tag entry using Bootstrap 4

by John Avis | October 15, 2019

For a website project I needed a way to enter multiple tags. I just wanted something simple that I could easily modify to suit my own needs, so I wrote my own.


ASP.NET Web Forms Web Development

ASP.NET bug with RadioButton GroupName in Repeater

by John Avis | September 1, 2019

I rediscovered a bug in ASP.NET that affects RadioButtons inside repeaters. Here is my solution to the problem.

Comments

John Avis

by John Avis | July 31, 2007

Please note that bar codes may be difficult or impossible to scan if printed on anything other than a laser printer or similar high quality printer.

Reply

Leave a Comment

Tags

About me

...random postings about web development and programming, Internet, computers, electronics and automotive topics.

Subscribe

Get the latest posts delivered to your inbox.