Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web-based barcode generation

Status
Not open for further replies.

wongbear

MIS
Apr 2, 2003
5
Can anyone tell me how to create web-based barcode in the backend server ?

I am using Linux/PHP/PostgreSQL backend and
Windows IE browser as front-end

Many thanks
 
It's very useful.

However, any open-source software available ?
 
I use Perl and GD::Barcode.

Make the src of the image tag call a program passing the barcode as a parameter eg:

<img src=&quot;/cgi-bin/barcode/print_barcode.pl?123456&quot;>...

and a stand-alone Perl script in the .../cgi-bin/barcode directory with the following code:-

#!/usr/bin/perl

my $Barcode = $ENV{QUERY_STRING};
$Barcode =~ tr/+/ /;

use GD::Barcode::Code39;

my $oGdB = GD::Barcode::Code39->new(&quot;*$Barcode*&quot;);
my $oGD = $oGdB->plot(NoText=>1, Height => 20);
print &quot;Content-Type: image/png\n\n&quot;;
print $oGdB->plot->png;

exit;

Make sure that you have the GD::Barcode module first, though ;-)

Doug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top