Hi all!!

A library uses Code 128B <https://en.wikipedia.org/wiki/Code_128> for its
material barcodes, with the great ByWater's Label Maker
<https://github.com/bywatersolutions/koha-plugin-label-maker> plugin. For
the SVG image generation, we were using barcode.tec-it.com
<https://barcode.tec-it.com/barcode.ashx?data=>, but they start reducing
their usage limits, so I look back to Koha capabilities.

As we know, Koha doesn't support Code128B
<https://github.com/Koha-Community/Koha/blob/main/svc/barcode#L92>. It
seems the libbarcode-code128-perl
<https://metacpan.org/release/Barcode-Code128> dependency package is used
only for OPACVirtualCardBarcode, where is a viable option.

I could generate PNG 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);
    $code->option("border", 0);
    $code->option("transparent_text", 1);
    $code->option("scale", 4);
    $code->option("font_align", "center");
    $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.

Before I file a bug and maybe trying with JsBarcode or even Jquery.. there
is something I'm missing? Code 128 is not so un popular. Why is not
supported? Also, a `format` parameter would be great, for a future SVG and
stretch without loosing any quality.

Regards,
Pablo
_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : https://www.koha-community.org/
git : https://git.koha-community.org/
bugs : https://bugs.koha-community.org/

Reply via email to