Created
December 16, 2010 10:57
-
-
Save Songmu/743283 to your computer and use it in GitHub Desktop.
make barcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use GD::Barcode::NW7; | |
use Math::CheckDigits; | |
my $bcd = qq{123432456}; | |
my $cd = Math::CheckDigits->new( | |
modulus => '10', | |
weight => [3,1], | |
); | |
$bcd = $cd->complete($bcd); | |
my $gd_barcode = GD::Barcode::NW7->new('A'.$bcd.'A'); | |
open my $fh,'>','barcode.png'; | |
binmode $fh; | |
print $fh $gd_barcode->plot()->png; | |
close $fh; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment