Re: code128.py
Robin Becker <[email protected]>
| Newsgroups | gmane.comp.python.reportlab.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Klaas, happy new year and thanks for the patch, I'll try and test soon. Do you have an example test string? That made a difference fairly obvious? -- Robin Becker On 04/01/2016 11:35, Klaas Feenstra wrote: > Hello, > > After using reportlab for creating barcodes, I realised the optimization > for Code128 was not correct. It was only optimizing the end of the barcode > string. > > I made modifications for the trailingDigitsToC function. See below. Now all > string will be analysed for optimizations. Probably there will be a better > algorithm, but this is working. > > def _trailingDigitsToC(self, l): > # Optimization: trailing digits -> set C double-digits ........... > else: > nl = nl + l[startpos:i+1] > i += 1 > return nl > > ........