Milan
Milan

Reputation: 1019

PHP script to calculate code128

All over the web I can find examples how to generate bar code images using php.

However I need function which will transform string into code128 value so that I can use it in OpenOffice and Word, format it using code128 font and get real bar code.

Although theoretically I could code it myself I believe there are already good and tested solutions.

More precisely: I need script which would turn: "3870639399632" into "ÍFf_}Ç_È2yÎ".

Upvotes: 2

Views: 22315

Answers (2)

Fisch Ost
Fisch Ost

Reputation: 1

Use the composer package "hbgl/php-code-128-encoder". https://packagist.org/packages/hbgl/php-code-128-encoder

$encoded = Code128Encoder::encode('ABC123456DEF');
assert ($encoded === 'ÌABCÇ,BXÈDEFqÎ');

Upvotes: 0

Related Questions