April 2012 Archives

Google just deprecated their image chart API that I use to create QR codes.  When I first looked into it a while ago, there wasn't a good solution that worked on the old Perl I was stuck with.   Now I'm all upgraded and looked again and found GD::Barcode::QRcode.  Works great.

This is pretty straight from the module's synopsis, but it took a second for me to get what I wanted, so I thought I'd post it.

# Create QR code with Perl

use strict;
use warnings;
use GD::Barcode::QRcode;

open my $OUT, '>', 'test.png';
binmode($OUT);

my $gd = GD::Barcode::QRcode->new(
	'http://m.cindyruppert.com',  
	{ Ecc => 'L', Version=>2, ModuleSize => 16},
);

print $OUT $gd->plot->png;
close $OUT;

About this Archive

This page is an archive of entries from April 2012 listed from newest to oldest.

November 2011 is the previous archive.

August 2012 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.38