SVG::Barcode - Base class for SVG 1D and 2D codes
use SVG::Barcode::Subclass; my $plotter = SVG::Barcode::Subclass->new; my $svg = $plotter->plot($text); $plotter->foreground; # black $plotter->background; # white $plotter->margin; # 2 $plotter->id; $plotter->class; $plotter->width; $plotter->height; $plotter->scale; %params = ( foreground => 'red', id => 'barcode', ); $plotter = SVG::Barcode::Subclass->new(%params);
SVG::Barcode is a base class for SVG 1D and 2D codes.
You will not use it directly, it will be loaded by its subclasses:
SVG::Barcode::Code128
SVG::Barcode::DataMatrix
SVG::Barcode::QRCode
$plotter = SVG::Barcode::Subclass->new; # create with defaults $plotter = SVG::Barcode::Subclass->new(%params);
$svg = $plotter->plot($text);
Creates a barcode.
$value = $plotter->background; $plotter = $plotter->background($newvalue); $plotter = $plotter->background(''); # white
Getter and setter for the background color. Default white.
white
$value = $plotter->class; $plotter = $plotter->class($newvalue); $plotter = $plotter->class(''); # ''
Getter and setter for the class of the svg element. Default ''.
''
$value = $plotter->foreground; $plotter = $plotter->foreground($newvalue); $plotter = $plotter->foreground(''); # black
Getter and setter for the foreground color. Default black.
black
$value = $plotter->height; $plotter = $plotter->height($newvalue); $plotter = $plotter->height(''); # ''
Getter and setter for the height of the svg element. Default ''.
$value = $plotter->id; $plotter = $plotter->id($newvalue); $plotter = $plotter->id(''); # ''
Getter and setter for the id of the svg element. Default ''.
$value = $plotter->margin; $plotter = $plotter->margin($newvalue); $plotter = $plotter->margin(''); # 2
Getter and setter for the margin around the barcode. Default 2.
2
$value = $plotter->scale; $plotter = $plotter->scale($newvalue); $plotter = $plotter->scale(''); # ''
Getter and setter for the scale of the svg element. Sets "width" and "height" to products of the width and height of the graphics. Used to display small barcodes without blur. Default ''.
$value = $plotter->width; $plotter = $plotter->width($newvalue); $plotter = $plotter->width(''); # ''
Getter and setter for the width of the svg element. Default ''.
© 2019–2020 by Tekki (Rolf Stöckli).
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
SVG::Barcode::Code128, SVG::Barcode::DataMatrix, SVG::Barcode::QRCode.
To install SVG::Barcode, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SVG::Barcode
CPAN shell
perl -MCPAN -e shell install SVG::Barcode
For more information on module installation, please visit the detailed CPAN module installation guide.