Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tekki/svg-barcode-code128

Perl module to generate SVG based Code 128 barcodes
https://github.com/tekki/svg-barcode-code128

Last synced: 24 days ago
JSON representation

Perl module to generate SVG based Code 128 barcodes

Awesome Lists containing this project

README

        

# NAME

SVG::Barcode::Code128 - Generator for SVG based Code 128 barcodes

# SYNOPSIS

use SVG::Barcode::Code128;

my $code128 = SVG::Barcode::Code128->new;
my $svg = $code128->plot('https://perldoc.pl');

$code128->linewidth; # 1
$code128->lineheight; # 30
$code128->textsize; # 10
# from SVG::Barcode:
$code128->foreground; # black
$code128->background; # white
$code128->margin; # 2
$code128->id;
$code128->class;
$code128->width;
$code128->height;
$code128->scale;

my %params = (
lineheight => 40,
textsize => 0,
);
$code128 = SVG::Barcode::Code128->new(%params);

# use as function
use SVG::Barcode::Code128 'plot_code128';

my $svg = plot_code128('https://perldoc.pl', %params);

# DESCRIPTION

[SVG::Barcode::Code128](https://metacpan.org/pod/SVG%3A%3ABarcode%3A%3ACode128) is a generator for SVG based Code 128 barcodes.

# FUNCTIONS

## plot\_code128

use SVG::Barcode::Code128 'plot_code128';

$svg = plot_code128($text, %params);

Returns a Code 128 barcode using the provided text and parameters.

# CONSTRUCTOR

## new

$code128 = SVG::Barcode::Code128->new; # create with defaults
$code128 = SVG::Barcode::Code128->new(\%params);

Creates a new Code 128 plotter. Inherited from [SVG::Barcode](https://metacpan.org/pod/SVG%3A%3ABarcode#new).

# METHODS

## plot

Creates a SVG code. Inherited from [SVG::Barcode](https://metacpan.org/pod/SVG%3A%3ABarcode#plot).

# PARAMETERS

Inherited from [SVG::Barcode](https://metacpan.org/pod/SVG%3A%3ABarcode):
[background](https://metacpan.org/pod/SVG%3A%3ABarcode#background),
[class](https://metacpan.org/pod/SVG%3A%3ABarcode#class),
[foreground](https://metacpan.org/pod/SVG%3A%3ABarcode#foreground),
[height](https://metacpan.org/pod/SVG%3A%3ABarcode#height),
[id](https://metacpan.org/pod/SVG%3A%3ABarcode#id),
[margin](https://metacpan.org/pod/SVG%3A%3ABarcode#margin),
[scale](https://metacpan.org/pod/SVG%3A%3ABarcode#scale),
[width](https://metacpan.org/pod/SVG%3A%3ABarcode#width).

## lineheight

$value = $code128->lineheight;
$code128 = $code128->lineheight($newvalue);
$code128 = $code128->lineheight(''); # 30

Getter and setter for the height of a line. Default `30`.

## linewidth

$value = $code128->linewidth;
$code128 = $code128->linewidth($newvalue);
$code128 = $code128->linewidth(''); # 1

Getter and setter for the width of a single line. Default `1`.

## textsize

$value = $code128->textsize;
$code128 = $code128->textsize($newvalue);
$code128 = $code128->textsize(''); # 10

Getter and setter for the size of the text a the bottom. `0` hides the text. Default `10`.

# AUTHOR & COPYRIGHT

© 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.

# SEE ALSO

[SVG::Barcode](https://metacpan.org/pod/SVG%3A%3ABarcode), [Barcode::Code128](https://metacpan.org/pod/Barcode%3A%3ACode128).