line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PDF::API2::Resource::XObject::Form::BarCode::codabar; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1020
|
use base 'PDF::API2::Resource::XObject::Form::BarCode'; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
628
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
41
|
|
6
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
400
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '2.044'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
1
|
|
|
1
|
1
|
4
|
my ($class, $pdf, %options) = @_; |
12
|
1
|
|
|
|
|
7
|
my $self = $class->SUPER::new($pdf, %options); |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
7
|
my @bars = $self->encode($options{'-code'}); |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
9
|
$self->drawbar([@bars], $options{'caption'}); |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
9
|
return $self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $codabar = q|0123456789-$:/.+ABCD|; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my @barcodabar = qw( |
24
|
|
|
|
|
|
|
11111221 11112211 11121121 22111111 11211211 |
25
|
|
|
|
|
|
|
21111211 12111121 12112111 12211111 21121111 |
26
|
|
|
|
|
|
|
11122111 11221111 21112121 21211121 21212111 |
27
|
|
|
|
|
|
|
11212121 aabbabaa ababaaba ababaaba aaabbbaa |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub encode_char { |
31
|
17
|
|
|
17
|
0
|
28
|
my $self = shift(); |
32
|
17
|
|
|
|
|
28
|
my $char = uc shift(); |
33
|
17
|
|
|
|
|
48
|
return $barcodabar[index($codabar, $char)]; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |