ASP Barcode Script
by johna | 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:
Download barcode.zip (1.24kb)
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, textSample ASP Barcode
Download barcode.zip (1.24kb)
Related Posts
Converting dBase IV programs to run in the browser
by johna | September 13, 2024
Some pointless entertainment trying to get some old dBase programs running in the browser.
How to set up a debugging using the Turnkey Linux LAMP stack and VS Code
by johna | December 19, 2023
The second part in my guide to setting up a website and database using the Turnkey Linux LAMP stack.
How to set up a website and database using the Turnkey Linux LAMP stack
by johna | November 18, 2023
If you need to host your own website for the purposes of web development, Turnkey Linux LAMP Stack is an easy to install all-in-one solution that you can set up on a spare computer or a VM (Virtual Machine).
Comments
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
by okan | August 19, 2020
dont work
Reply
by John | August 19, 2020
Did you mean the demo didn't work? It was missing some image files which I've added now and it is working again.
Reply
by Stu | September 9, 2020
Dont suppose you have some classic ASP magic for a QR code or how to get longer datastring into your example above without the barcode becoming massive.
Reply
by John | September 9, 2020
If you have set the width to the minimum of 1 then that is as narrow as a barcode can possibly get. Some other types of barcodes might be more efficient if you have the option to use a different type. QRCodes are quite efficient in size.
Reply