|
Barcode::RM4SCC - Generate Royal Mail 4 State Customer Code barcodes and barcode data |
Barcode::RM4SCC - Generate Royal Mail 4 State Customer Code (RM4SCC) barcodes and barcode data
use Barcode::RM4SCC;
my $obj = new Barcode::RM4SCC( String => 'WC1E6XY' );
my $pattern = $obj->barcode;
If you have GD installed you can:
my $gdObj = $obj->plot;
# or specify some options:
# my $gdObj = $obj->plot( WithText => 1, QuietZone => 10);
my $image = $gdObj->png;
and, for example, save the image to a file:
open(IMG, ">$aFilename") || die "Cannot open $aFilename: $!";
binmode(IMG);
print IMG $image;
close(IMG);
Generate Royal Mail 4 State Customer Code (RM4SCC) barcode data, and images
This module generates the sequence of bars required to encode a particular string as a Royal Mail 4 State Customer Code (RM4SCC) - a kind of height-modulated barcode used for automated postal sorting in the United Kingdom. If you have GD installed you can generate a bitmap image of the barcode, but GD is not required to use the rest of this module.
Data to be encoded may contain only uppercase letters and numbers. This module will ignore invalid characters. The checksum character is generated automatically for you, as are the start and stop bits.
You may notice that this module is not a subclass of GD::Barcode. I did want to integrate this module as much as possible with existing barcode modules, but it seems that GD::Barcode won't handle height-modulated barcodes such as this one. However, I have tried to keep the interface roughly similar.
This module has been written in good faith using information from the web. However, this may not match the actual specification for the RM4SCC so you should be very careful before using this module because it may get things wrong - and that may incur delays or even extra charges!
Having said that, the output does seem to match other sources of RM4SCC barcodes when I have compared them. If you do find errors or bugs please report them. See my area on CPAN for contact details.
I am not connected with the Royal Mail. To the best of my knowledge they don't know about this module, and hence there is no approval or endorsement from them.
If you intend to use the barcode image, according to references that I read
there should be 20 to 24 bars per 25.4mm (1 inch), which means that the image should be printed
at a resolution of 80 to 96 pixels per inch. A quiet zone of 2mm should exist around the
barcode and this is why the plot() method generates space around the barcode by default.
barcode()plot()
These are the options to new():
These are the options to plot():
transparent() method to make the background transparent.
Information from these URLs was used while writing this module:
Those websites are not connected with me or this module.
P Kent
Copyright 2004 by P Kent
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
Barcode::RM4SCC - Generate Royal Mail 4 State Customer Code barcodes and barcode data |