Lines 45-50
sub new {
Link Here
|
45 |
width => $params{'width'}, |
45 |
width => $params{'width'}, |
46 |
layout => $params{'layout'}, |
46 |
layout => $params{'layout'}, |
47 |
text_wrap_cols => $params{'text_wrap_cols'}, |
47 |
text_wrap_cols => $params{'text_wrap_cols'}, |
|
|
48 |
barcode_height_scale => $params{'layout'}->{'barcode'}[0]->{'height_scale'} || 0.01, |
49 |
barcode_width_scale => $params{'layout'}->{'barcode'}[0]->{'width_scale'} || 0.8, |
48 |
}; |
50 |
}; |
49 |
bless ($self, $type); |
51 |
bless ($self, $type); |
50 |
return $self; |
52 |
return $self; |
Lines 52-65
sub new {
Link Here
|
52 |
|
54 |
|
53 |
sub draw_barcode { |
55 |
sub draw_barcode { |
54 |
my ($self, $pdf) = @_; |
56 |
my ($self, $pdf) = @_; |
55 |
#FIXME: We do some scaling foo on the barcode here which probably should be done by the one invoking draw_barcode |
57 |
# Default values for barcode scaling are set in constructor to work with pre-existing installations |
56 |
my $barcode_width = 0.8 * $self->{'width'}; # this scales the barcode width to 80% of the label width |
58 |
my $barcode_height_scale = $self->{'barcode_height_scale'}; |
57 |
my $barcode_y_scale_factor = 0.01 * $self->{'height'}; # this scales the barcode height to 1% of the label height |
59 |
my $barcode_width_scale = $self->{'barcode_width_scale'}; |
|
|
60 |
|
58 |
_draw_barcode( $self, |
61 |
_draw_barcode( $self, |
59 |
llx => $self->{'llx'} + $self->{'layout'}->{'barcode'}->[0]->{'llx'}, |
62 |
llx => $self->{'llx'} + $self->{'layout'}->{'barcode'}->[0]->{'llx'}, |
60 |
lly => $self->{'lly'} + $self->{'layout'}->{'barcode'}->[0]->{'lly'}, |
63 |
lly => $self->{'lly'} + $self->{'layout'}->{'barcode'}->[0]->{'lly'}, |
61 |
width => $barcode_width, |
64 |
width => $self->{'width'} * $barcode_width_scale, |
62 |
y_scale_factor => $barcode_y_scale_factor, |
65 |
y_scale_factor => $self->{'height'} * $barcode_height_scale, |
63 |
barcode_type => $self->{'layout'}->{'barcode'}->[0]->{'type'}, |
66 |
barcode_type => $self->{'layout'}->{'barcode'}->[0]->{'type'}, |
64 |
barcode_data => $self->{'layout'}->{'barcode'}->[0]->{'data'}, |
67 |
barcode_data => $self->{'layout'}->{'barcode'}->[0]->{'data'}, |
65 |
text => $self->{'layout'}->{'barcode'}->[0]->{'text_print'}, |
68 |
text => $self->{'layout'}->{'barcode'}->[0]->{'text_print'}, |