|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Barcode for EAN 5Typically on a book one has a barcode for the ISBN (EAN-13) and
optionally a barcode for the price (EAN-5). Inkscape 47 rel 3 provides the first but not the second. Could this be added? -- John Culleton "Create Book Covers with Scribus" http://www.booklocker.com/books/4055.html ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Inkscape-user mailing list Inkscape-user@... https://lists.sourceforge.net/lists/listinfo/inkscape-user |
|
|
Re: Barcode for EAN 5I would suggest filing this as a bug report.
|
|
|
Re: Barcode for EAN 5John Culleton wrote:
> Typically on a book one has a barcode for the ISBN (EAN-13) and > optionally a barcode for the price (EAN-5). Inkscape 47 rel 3 provides > the first but not the second. Could this be added? (Grain of salt: I don't know anything about barcodes. I simply edited the EAN13 code after a very quick reading of the WP page on EAN5) The attached python script might render EAN5 barcodes in Inkscape after slight and obvious edits to Barcode/__init__.py and render_barcodes.inx I'm unable to create a patch myself right now, but if someone can prove that it works please turn it into a proper patch. Aaron Spike ''' Copyright (C) 2007 Martin Owens Copyright (C) 2009 Aaron C Spike Thanks to Lineaire Chez of Inkbar ( www.inkbar.lineaire.net ) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' from Base import Barcode import sys mapLeftFamily = [ [ "0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011" ], #L [ "0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111" ], #G ] mapFamily = [ '11000','10100','10010','10001','01100','00110','00011','01010','01001','00101' ] startBar = '01011'; sepBar = '01'; class Object(Barcode): def encode(self, number): result = [] if len(number) != 5 or not number.isdigit(): sys.stderr.write("Can not encode '" + number + "' into EAN5 Barcode, Size must be 5 numbers only\n") return check = self.getChecksum(number) family = mapFamily[check] for i in range(5): mapLeft = mapLeftFamily[int(family[i])] result.append(mapLeft[int(number[i])]) self.label = number self.inclabel = self.label return startBar + '01'.join(result) def getChecksum(self, number): return sum([int(n)*int(m) for n,m in zip(number, '39393')]) % 10 def getStyle(self, index): result = { 'width' : '1', 'top' : int(self.y), 'write' : True } if index==0: # White Space result['write'] = False elif index==1: # Black Bar result['height'] = int(self.height) elif index==2: # Guide Bar result['height'] = int(self.height) + 5 return result ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Inkscape-user mailing list Inkscape-user@... https://lists.sourceforge.net/lists/listinfo/inkscape-user |
| Free embeddable forum powered by Nabble | Forum Help |