Bug 39113 - Support Code 128 barcodes
Summary: Support Code 128 barcodes
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Chris Nighswonger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-12 18:35 UTC by Pablo AB
Modified: 2025-02-12 18:35 UTC (History)
0 users

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo AB 2025-02-12 18:35:33 UTC
As we know, Koha doesn't yet support Code128B. It seems the libbarcode-code128-perl dependency package is used only for OPACVirtualCardBarcode, where is an option.

I could generate PNG (sadly no SVG) barcodes by naively tweaking `svc/barcode`:

use Barcode::Code128;

my %type_mapping = (
  Code128b       => 1,
);

eval {
  if ( $type eq "Code128b") {
    my $code = new Barcode::Code128;
    $code->option("height", $height);
    $code->option("show_text", !$notext);
    $image = $code->png($barcode);
  }
};

And ./cgi-bin/koha/svc/barcode?barcode=3721M&type=Code128b, but for some reason it fails (error 500) with some barcodes.

Original post: https://www.mail-archive.com/koha-devel@lists.koha-community.org/msg14428.html