Community mailing list archives

community@mail.odoo.com

Re: Printing Code128 Barcode !

by
Naresh Soni
- 05/20/2016 05:11:52
Hi Jos,

Thanks a lot.

Regards,

Regards,
Naresh Soni
Founder and Consultant
Cozy Business Solutions Pvt. Ltd
+91 8866 370537



On 20 May 2016 at 13:17, Jos De Graeve <jos.degraeve@apertoso.be> wrote:
Hi Naresh,

We have done a project needing GS1-128 barcodes for shipping labels. ( note that GS1-128 is based on ean-128 but defines some extra stuff ) https://en.wikipedia.org/wiki/GS1-128

We have found it particularly hard to encode the so called "Application Identifiers" such as FNC-1 etc.  These identifiers are not encoded in ascii and a lot of barcode tools choke on that.  

We created the report with aeroo reports and ended up generating the GS1-128 barcodes with https://zint.github.io/, an commandline utility.  Calling zint like this:

@api.model
def get_barcode(self, value, height=50):
if value is None:
return None
zint_args = [
'/usr/bin/zint', # the executable
'--barcode=16', # 16: GS1-128
'--height=%s' % height, # Height of symbol in multiples of x-dimension.
'--scale=2', # Adjust size of output image. ( more pixels )
'--whitesp=5', # Width of whitespace in multiples of x-dimension.
'--directpng', # output png data on stdout
'--data=%s' % value # data barcode
]

data = b64encode(subprocess.check_output(zint_args))
return data
....
return self.get_barcode('[02]%s[15]%s[37]%s[10]%s' % (
    ean_case.zfill(14), best_before_reverse, unit_count, lot),
    height=height)

Zint takes care of translating the application identifiers between square brackets to the right FNC1 codes

When using this take care of corse with user input

Regards,


Jos De Graeve - Apertoso business ICT


Guido Gezellelaan 16 - B-9800 Deinze - Belgium
 
mail/im/skype: Jos.DeGraeve@apertoso.be - apertoso

2016-05-20 9:02 GMT+02:00 Naresh Soni <jmnaresh@gmail.com>:
Hi Community,

Has anyone ever passed through the issue in odoo 8.0 when printing code128 barcode which has such a big string 200010101-0001-THD-01-S-BLK-100001 Odoo prints it but when scanned through the scanner the scanner doesn't recognize it nor its decoded using online tools.

Any Idea !

Thanks,
Regards,
Naresh Soni
Founder and Consultant
Cozy Business Solutions Pvt. Ltd
+91 8866 370537


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe