--- a/src/C4/Labels/Label.pm 2018-09-20 12:15:04.678706379 +0300 +++ b/src/C4/Labels/Label.pm 2019-08-27 15:44:20.682597996 +0300 @@ -592,6 +592,23 @@ warn sprintf('Barcode generation failed for item %s with this error: %s', $self->{'item_number'}, $@); } } + elsif ($params{'barcode_type'} eq 'QRCODE') { + eval { + PDF::Reuse::Barcode::QRcode( + x => $params{'llx'}, + y => $params{'lly'}, + value => $params{barcode_data}, + mode => 'graphic', + text => '', + drawbackground => 0, + qr_version => 1, + modulesize => 1, + ); + }; + if ($@) { + warn sprintf('Barcode generation failed for item %s with this error: %s', $self->{'item_number'}, $@); + } + } else { warn "unknown barcode_type: $params{barcode_type}"; } @@ -653,6 +670,9 @@ =item . EAN13 = The standard EAN-13 barcode +=item . + QRCODE = The 2D QRcode barcode + =back C Defines the general layout to be used on labels. NOTE: At present there are only five printing types supported in the label creator code: --- a/src/C4/Creators/Lib.pm 2018-06-29 12:49:04.824675960 +0300 +++ b/src/C4/Creators/Lib.pm 2019-08-27 15:16:43.700311154 +0300 @@ -97,6 +97,7 @@ # {type => 'NW7', name => 'NW7', desc => 'Creates a NW7 barcodes from a string consisting of the numeric characters 0-9', selected => 0}, # {type => 'UPCA', name => 'UPCA', desc => 'Translates a string of 11 or 12 digits to UPCA barcodes. The check number (the 12:th digit) is calculated if not supplied.', selected => 0}, # {type => 'UPCE', name => 'UPCE', desc => 'Translates a string of 6, 7 or 8 digits to UPCE barcodes. If the string is 6 digits long, '0' is added first in the string. The check number (the 8:th digit) is calculated if not supplied.', selected => 0}, + {type => 'QRCODE', name => 'QRCODE', desc => 'Creates version 1 with modulesize=1 (small) QRCode', selected => 0}, ]; my $label_types = [ --- a/src/C4/Patroncards/Patroncard.pm 2019-08-28 14:14:16.384626784 +0300 +++ b/src/C4/Patroncards/Patroncard.pm 2019-08-28 14:20:16.063364440 +0300 @@ -422,6 +422,23 @@ warn sprintf('Barcode generation failed for item %s with this error: %s', $self->{'item_number'}, $@); } } + elsif ( $params{'barcode_type'} eq 'QRCODE' ) { + eval { + PDF::Reuse::Barcode::QRcode( + x => $params{'llx'}* $self->{'unitvalue'}, + y => $params{'lly'}* $self->{'unitvalue'}, + value => $params{barcode_data}, + mode => 'graphic', + text => '', + drawbackground => 0, + qr_version => 1, + modulesize => 1, + ); + }; + if ($@) { + warn sprintf('Barcode generation failed for item %s with this error: %s', $self->{'item_number'}, $@); + } + } } 1;