c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #00929
[Bug 664345] Re: FNC1 symbol in barcode
Fixed
** Patch removed: "barcode_fnc1.diff"
https://bugs.launchpad.net/openobject-server/+bug/664345/+attachment/1706329/+files/barcode_fnc1.diff
** Patch added: "barcode_fnc1.diff"
https://bugs.launchpad.net/openobject-server/+bug/664345/+attachment/1706409/+files/barcode_fnc1.diff
--
FNC1 symbol in barcode
https://bugs.launchpad.net/bugs/664345
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP OpenObject.
Status in OpenObject Server: New
Bug description:
Hello.
I make an RML report with barcode of "code128 " kind.
Is there a way to insert a special FNC1 symbol (field delimeter) in the barcode? This is required this because there are fields of variable length in barcode.
The Reportlab documentation says: "Code 128 is a very compact symbology that can encode the entire 128 character ASCII set, plus 4 special control codes, (FNC1-FNC4, expressed in the input string as \xf1 to \xf4)."
So Python code like "bar=code128.Code128("\xf412\xf134567890",xdim=100*mm)" works well.
But when i try to insert this symbol between <barCode> an </barCode> inside RML template i get:
File "reportlab\platypus\doctemplate.pyo", line 756, in build
File "reportlab\platypus\doctemplate.pyo", line 649, in handle_flowable
File "reportlab\platypus\frames.pyo", line 159, in _add
File "reportlab\platypus\flowables.pyo", line 121, in wrap
File "reportlab\graphics\barcode\common.pyo", line 107, in width
File "reportlab\graphics\barcode\common.pyo", line 57, in _calculate
File "reportlab\graphics\barcode\code128.pyo", line 243, in validate
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position 0: ordinal not in range(128)
Tried to insert it many ways: ñ ñ; [['\xf1']] or [[u'xf1']]
I think something is wrong in trml2pdf.py... it transmits an unicode string where should be "simple" one
References