Bugzilla – Attachment 8670 Details for
Bug 6448
EAN-13 barcode support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6448 [3/3] EAN-13 barcode labels
Bug-6448-33-EAN-13-barcode-labels.patch (text/plain), 4.50 KB, created by
Dobrica Pavlinusic
on 2012-03-28 13:51:21 UTC
(
hide
)
Description:
Bug 6448 [3/3] EAN-13 barcode labels
Filename:
MIME Type:
Creator:
Dobrica Pavlinusic
Created:
2012-03-28 13:51:21 UTC
Size:
4.50 KB
patch
obsolete
>From 68160665b993fcd1a9acb1a3c2d8094e0d8cca1f Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Sat, 4 Jun 2011 14:23:20 +0200 >Subject: [PATCH] Bug 6448 [3/3] EAN-13 barcode labels > >Current implementation doesn't scale barcodes because low-price >CCD barcode readers are very sensitive about size > >Test scenario: > >1. in Tools > Labels create or edit Layout and select EAN13 as barcode > type > >2. export one of existing batches using EAN13 layout and verify that > generated pdf file contains barcodes > >3. print pdf file and test it with barcode reader >--- > C4/Creators/Lib.pm | 2 +- > C4/Labels/Label.pm | 25 +++++++++++++++++++++++++ > 2 files changed, 26 insertions(+), 1 deletions(-) > >diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm >index 8fd25fd..b26949e 100644 >--- a/C4/Creators/Lib.pm >+++ b/C4/Creators/Lib.pm >@@ -90,7 +90,7 @@ my $barcode_types = [ > {type => 'CODE39MOD', name => 'Code 39 + Modulo43', desc => 'Translates the characters 0-9, A-Z, \'-\', \'*\', \'+\', \'$\', \'%\', \'/\', \'.\' and \' \' to a barcode pattern. Encodes Mod 43 checksum.', selected => 0}, > {type => 'CODE39MOD10', name => 'Code 39 + Modulo10', desc => 'Translates the characters 0-9, A-Z, \'-\', \'*\', \'+\', \'$\', \'%\', \'/\', \'.\' and \' \' to a barcode pattern. Encodes Mod 10 checksum.', selected => 0}, > {type => 'COOP2OF5', name => 'COOP2of5', desc => 'Creates COOP2of5 barcodes from a string consisting of the numeric characters 0-9', selected => 0}, >-# {type => 'EAN13', name => 'EAN13', desc => 'Creates EAN13 barcodes from a string of 12 or 13 digits. The check number (the 13:th digit) is calculated if not supplied.', selected => 0}, >+ {type => 'EAN13', name => 'EAN13', desc => 'Creates EAN13 barcodes from a string of 12 or 13 digits. The check number (the 13:th digit) is calculated if not supplied.', selected => 0}, > # {type => 'EAN8', name => 'EAN8', desc => 'Translates a string of 7 or 8 digits to EAN8 barcodes. The check number (the 8:th digit) is calculated if not supplied.', selected => 0}, > # {type => 'IATA2of5', name => 'IATA2of5', desc => 'Creates IATA2of5 barcodes from a string consisting of the numeric characters 0-9', selected => 0}, > {type => 'INDUSTRIAL2OF5', name => 'Industrial2of5', desc => 'Creates Industrial2of5 barcodes from a string consisting of the numeric characters 0-9', selected => 0}, >diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm >index d1ab98a..cf04e47 100644 >--- a/C4/Labels/Label.pm >+++ b/C4/Labels/Label.pm >@@ -553,6 +553,28 @@ sub barcode { > warn sprintf('Barcode generation failed for item %s with this error: %s', $self->{'item_number'}, $@); > } > } >+ elsif ($params{'barcode_type'} eq 'EAN13') { >+ $bar_length = 4; # FIXME >+ $num_of_bars = 13; >+ $tot_bar_length = ($bar_length * $num_of_bars) + ($guard_length * 2); >+ $x_scale_factor = ($params{'width'} / $tot_bar_length) * 0.9; >+ eval { >+ PDF::Reuse::Barcode::EAN13( >+ x => $params{'llx'}, >+ y => $params{'lly'}, >+ value => sprintf('%013d',$params{barcode_data}), >+# xSize => $x_scale_factor, >+# ySize => $params{'y_scale_factor'}, >+ mode => 'graphic', >+ ); >+ }; >+ if ($@) { >+ warn sprintf('Barcode generation failed for item %s with this error: %s', $self->{'item_number'}, $@); >+ } >+ } >+ else { >+ warn "unknown barcode_type: $params{barcode_type}"; >+ } > } > > sub csv_data { >@@ -608,6 +630,9 @@ This module provides methods for creating, and otherwise manipulating single lab > =item . > INDUSTRIAL2OF5 = The standard 2 of 5 barcode (a binary level bar code developed by Identicon Corp. and Computer Identics Corp. in 1970) > >+=item . >+ EAN13 = The standard EAN-13 barcode >+ > =back > > C<printing_type> Defines the general layout to be used on labels. NOTE: At present there are only five printing types supported in the label creator code: >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6448
:
8668
|
8669
|
8670
|
9192
|
10019
|
10127
|
10128
|
10129
|
10130
|
10134
|
11041
|
11042
|
11043
|
11349