CodeBarre Code128

Salut à tous,

Je suis en train de mettre en place le composant Barcode qui était utilisé dans la technote.

Mon problème est que je dois générer un Code128-Auto (ou Code128ABC) et dans ce composant, je ne peux faire que du A, B, ou C, pas du Auto.
Avant que j’essaie de voir comment faire ça de moi-même, est-ce que quelqu’un aurait déjà fait ça ? Ou un autre composant qui gèrerait ça ?

Merci d’avance.

The idea of AUTO is to use the most efficient type inline, The Tech Note does not support this mode. It is up to the app to decide how aggressively the switching is performed.

A simple implementation:

  • if the code is numeric only, even number of digits, use C.
  • otherwise use A or B,
  • if the first half of the code is made of several leading numerics and the last half is alphanumeric, start with C, switch to A or B midway,

c.f.

“BARCODE_CODE128” automatically switches between modes and adds a modulo-103 check digit.

Hi and thanks. Yes, the techno te does not support the Auto mode, and i may try to do it myself, following the simple implementation you gave.
But… If your zint plugin may do the job, why reinvent it ?.. :slight_smile:

I will check your plugin and examples in it and see if i can use it easily… thanks again, as always you rock. :slight_smile:

Well… i didn’t find any examples nor docs. So i have no idea how to use your plugin… Any link or example somewhere ?

no more documentation into github, strange ?

Because we now have project mode, and all 4D methods are accessible directly online, I prefer not to put sample code on the README page; the content may get out of sync.

As for the syntax, you see that there is a link at the bottom of the README.

Oh, i didn’t noticed the link was about that. I thought it was for all your projects and i didn’t click… :slight_smile:

So, i was able to make a barcode.
And some options work, but most seems to do nothing :

This 3 are working :

OB FIXER(zint_params;ZINT_TYPE;BARCODE_CODE128)
OB FIXER(zint_params;ZINT_FORMAT;ZINT_Format_SVG)
OB FIXER(zint_params;ZINT_NO_TEXT;Vrai)

But changing value for this ones change nothing to the output :

OB FIXER(zint_params;ZINT_WHITE_SPACE;vWhiteSpace)
OB FIXER(zint_params;ZINT_BORDER;vBorder)
OB FIXER(zint_params;ZINT_BOX;(vBoxed#0))
OB FIXER(zint_params;ZINT_BIND;(vBind#0))
OB FIXER(zint_params;ZINT_SCALE;vScale)
OB FIXER(zint_params;ZINT_HEIGHT;vHeight)

I can’t answer for BIND (I need to study how row stacking works) I see in the source code that I did not implement stacking.

But the others seem to work:

C_OBJECT(zint_params)

OB SET(zint_params;ZINT_TYPE;BARCODE_CODE128)
OB SET(zint_params;ZINT_FORMAT;ZINT_Format_SVG)
OB SET(zint_params;ZINT_NO_TEXT;True)
OB SET(zint_params;ZINT_WHITE_SPACE;5)
OB SET(zint_params;ZINT_SCALE;10)
OB SET(zint_params;ZINT_HEIGHT;3)
OB SET(zint_params;ZINT_BOX;True)
OB SET(zint_params;ZINT_BORDER;1)

$status:=ZINT ("123456abcdef";zint_params)

$image:=$status.image
SET PICTURE TO PASTEBOARD($image)

Do you need stacking support?

c.f. http://zint.org.uk/Manual.aspx?type=p&page=6

Weird, in my tests, setting any values to this options didn’t change anything.

Anyway, i was able to do what i needed with only the first 3, thanks again for your work.

Ok, i got the issue. In my test dialog, i didn’t declare the vars used to set the params, and i guess there was an issue with that (they were probably seen as Text instead of LongInt/Real).

When declaring the vars, it works far better… :slight_smile: