Koha-clms/C4
David Cook 9da5f23f96
Bug 40473: Use better algorithm for calculating Code39 barcode length
This patch uses the PDF::Reuse::Barcode algorithm for calculating barcode
background box length relative to barcode length in order to determine
the actual barcode width and thus the X scale factor required to re-size
that barcode so that it fits on the label width (or rather the
"Barcode width" which is a percentage applied to the label width
to create a narrower usable surface for the barcode and barcode background
box).

To test:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=29
2. Add an item with barcode 123456, add an item with barcode 39999000001310399991,
    and ensure an item with barcode 39999000001310 already exists
3. Go to http://localhost:8081/cgi-bin/koha/labels/label-manage.pl?label_element=batch
4. Create a patch that uses 3 items using 39999000001310, 2 items with 123456,
    and 2 items with 39999000001310399991
4. Go to http://localhost:8081/cgi-bin/koha/labels/label-manage.pl?label_element=layout
5. Edit the layout "Label Test"
6. Change the "Barcode width" to 1, and enable "Draw guide boxes", and click "Save"
7. Export the batch using the template "Avery 5160 | 1 x 2-5/8" and the layout "Label Test" and open as PDF
8. Note that the whole barcode fits inside the red guidebox (there should be some
overlap of white on top of the red guidebox but that is normal since we're using 100% of the
barcode label width).
9. Edit the "Label Test" layout to try "Code39 + Modulo43" and "Code39 + Modulo10" and retry batch export
10. Edit the "Label Test" and try different "Barcode width" like the usual default .8
11. Celebrate that your barcodes fit on the label!

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-26 10:36:41 -06:00
..
AuthoritiesMarc Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Barcodes Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ClassSortRoutine Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ClassSplitRoutine Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Creators Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
External Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Form Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Heading Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ILSDI Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Installer Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Labels Bug 40473: Use better algorithm for calculating Code39 barcode length 2025-09-26 10:36:41 -06:00
Linker Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Members Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
OAI Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Output Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Patroncards Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Reports Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
SIP Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Search Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Serials Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Utils/DataTables Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Accounts.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Acquisition.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Auth.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Auth_cas_servers.yaml.sample
…
Auth_with_cas.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Auth_with_ldap.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Auth_with_shibboleth.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
AuthoritiesMarc.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Barcodes.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Biblio.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Breeding.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Budgets.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Calendar.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Charset.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Circulation.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ClassSortRoutine.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ClassSource.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ClassSplitRoutine.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Context.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Contract.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
CourseReserves.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Creators.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
HTML5Media.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Heading.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
HoldsQueue.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ImportBatch.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ImportExportFramework.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
InstallAuth.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Installer.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ItemCirculationAlertPreference.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Items.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Koha.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Labels.pm
…
Languages.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Letters.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Linker.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Log.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
MarcModificationTemplates.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Matcher.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Members.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Message.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Output.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Overdues.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Patroncards.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Record.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Reports.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Reserves.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Ris.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
RotatingCollections.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
SMS.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Scheduler.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Scrubber.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Search.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Serials.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Service.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ShelfBrowser.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
SocialData.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Stats.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Suggestions.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
TTParser.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Tags.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Templates.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
TmplToken.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
TmplTokenType.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
UsageStats.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
XISBN.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
XSLT.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00