Bug 40478 - Add option to justify barcode on labels
Summary: Add option to justify barcode on labels
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-23 07:06 UTC by David Cook
Modified: 2026-01-27 22:41 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patchset adds a "Barcode justification" option to label layouts. This allows the user to justify CODE39, COOP2of5, Industrial2of5 and EAN13 barcodes independently of any other content in the label layout.
Version(s) released in:
Circulation function:


Attachments
Bug 40478: Database update to add barcode_justify column to creator_layouts (1.37 KB, patch)
2026-01-21 18:33 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 40478: Add ability to justify CODE39 barcodes (14.99 KB, patch)
2026-01-21 18:33 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 40478: Add support for COOP2of5, Industrial2of5 and EAN13 (1.49 KB, patch)
2026-01-27 22:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 40478: Database update to add barcode_justify column to creator_layouts (1.37 KB, patch)
2026-01-27 22:38 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 40478: Add ability to justify CODE39 barcodes (15.67 KB, patch)
2026-01-27 22:38 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 40478: Add support for COOP2of5, Industrial2of5 and EAN13 (1.49 KB, patch)
2026-01-27 22:38 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2025-07-23 07:06:42 UTC
Bug 40473 fixes barcode length calculator of Code39 barcodes in the label creator. When using barcode width of 1 or 100%, the barcode will be centred on the label.

But if you use a smaller barcode width, your barcode will be left aligned.

Surely it would be good to have the ability to have centred barcodes even when using narrower barcodes?
Comment 1 Lucas Gass (lukeg) 2026-01-21 18:33:11 UTC
Created attachment 191811 [details] [review]
Bug 40478: Database update to add barcode_justify column to creator_layouts
Comment 2 Lucas Gass (lukeg) 2026-01-21 18:33:14 UTC
Created attachment 191812 [details] [review]
Bug 40478: Add ability to justify CODE39 barcodes
Comment 3 Lucas Gass (lukeg) 2026-01-21 18:34:59 UTC
WIP. So far only handling CODE39 and I have not tested with the different barcode widths that David mentions.
Comment 4 Lucas Gass (lukeg) 2026-01-27 22:32:01 UTC
Created attachment 192111 [details] [review]
Bug 40478: Add support for COOP2of5, Industrial2of5 and EAN13
Comment 5 Lucas Gass (lukeg) 2026-01-27 22:38:53 UTC
Created attachment 192112 [details] [review]
Bug 40478: Database update to add barcode_justify column to creator_layouts
Comment 6 Lucas Gass (lukeg) 2026-01-27 22:38:56 UTC
Created attachment 192113 [details] [review]
Bug 40478: Add ability to justify CODE39 barcodes

To test:
1. Apply patch, updatedatabase, restart_all
2. Create at least 1 label batch
3. Create or edit an existing layout.
4. You should now see a dropdown labeled "Barcode justification:" with options to align left, right, and center.
5. At this point I like to check "Draw guide boxes" as it makes testing alignment much easier.
6. Now test generating label sets to "Download as PDF".
7. You will want to make sure the barcode properly aligns left, right, and center.
8. Test with all the  different "Choose barcode type (encoding):" options. Ensuring the barcodes align correectly left, right, and center.
9. Also test with all the different "Choose layout type:" that will display a barcode.
Comment 7 Lucas Gass (lukeg) 2026-01-27 22:38:58 UTC
Created attachment 192114 [details] [review]
Bug 40478: Add support for COOP2of5, Industrial2of5 and EAN13