[Koha-bugs] [Bug 14149] Labels: Make barcode width and height scaling editable

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 1 11:58:46 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14149

--- Comment #3 from Theodoros Theodoropoulos <theod at lib.auth.gr> ---
This proposed addition to have the user define the size of the barcode is very
useful indeed!

But until then, with the current situation, we realized that the hardcoded
relative values in Label.pm were very conservative for 'normal'-sized labels

For our needs, we found out that a default value of 20% of the label height and
90% of the label width (compared to the original values of 10% and 80%
respectably) produce taller barcodes that are easier to read.


In case it helps anyone, the relevant patch to achieve this is:
--- ./src/C4/Labels/Label.pm   2015-10-01 10:35:54.414837999 +0300
+++ ./src/C4/Labels/Label.pm.orig      2015-10-01 10:34:38.470837999 +0300
@@ -282,8 +282,8 @@
     my $self = shift;
     my $barcode_llx = $self->{'llx'} + $self->{'left_text_margin'};     # this
places the bottom left of the barcode the left text margin distance to right of
the left edge of the label ($llx)
     my $barcode_lly = $self->{'lly'} + $self->{'top_text_margin'};      # this
places the bottom left of the barcode the top text margin distance above the
bottom of the label ($lly)
-    my $barcode_width = 0.8 * $self->{'width'};                         # this
scales the barcode width to 80% of the label width
-    my $barcode_y_scale_factor = 0.01 * $self->{'height'};              # this
scales the barcode height to 10% of the label height
+    my $barcode_width = 0.9 * $self->{'width'};                         # this
scales the barcode width to 90% of the label width
+    my $barcode_y_scale_factor = 0.02 * $self->{'height'};              # this
scales the barcode height to 20% of the label height
     return 0, 0, 0, $barcode_llx, $barcode_lly, $barcode_width,
$barcode_y_scale_factor;
 }

(Needless to say again that the best approach would be to make it selectable by
the user in the template screen!)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list