https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40473

--- Comment #1 from David Cook <[email protected]> ---
In PDF::Reuse::Barcode, the barcode is actually rendered on top of a white
background, and that white background is calculated using this code:

$length     = 20 + (length($sPtn) * 0.9);

20 is an arbitrary number chosen by the creator of PDF::Reuse::Barcode to add
padding around the barcode. 

Now $sPtn is the output of the following:

my $oGDBar = GD::Barcode::Code39->new($value);
$sPtn = $oGDBar->barcode();

Consider you have the Koha item barcode 39999000001310

The $sPtn will contain the following:
1000101110111010111011100010101010111000101110101011100010111010101110001011101010111000101110101010001110111010101000111011101010100011101110101010001110111010101000111011101011101000101011101110111000101010111010001010111010100011101110101000101110111010

When we use this calculation from PDF::Reuse::Barcode in Koha to calculate the
barcode length, we get the *real* length of the barcode. 

With this patched, if we use a "Barcode width" of "1", the barcode plus its
white barcode box background will take up 100% of the label. Thanks to that 20
point padding, we'll have some whitespace on the left and right sides of the
barcode.

When using a "Barcode with" of 1, you get a perfectly centered barcode as well.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to