Hbgl php code 128 encoder


<?php
use BarcodeBakery\Common\BCGFontFile;
use BarcodeBakery\Common\BCGColor;
use BarcodeBakery\Common\BCGDrawing;
use BarcodeBakery\Barcode\BCGcode128;

$font = new BCGFontFile(__DIR__ . '/font/Arial.ttf', 18);
$colorBlack = new BCGColor(0, 0, 0);
$colorWhite = new BCGColor(255, 255, 255);

// Barcode Part
$code = new BCGcode128();
$code->setScale(2);
$code->setThickness(30);
$code->setForegroundColor($colorBlack);
$code->setBackgroundColor($colorWhite);
$code->setFont($font);
$code->setStart(null);
$code->setTilde(true);
$code->parse('a123');

// Drawing Part
$drawing = new BCGDrawing($code, $colorWhite);

header('Content-Type: image/png');

$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);
?>

Questions : PHP script to calculate code128

2022-09-14T12:47:46+00:00 2022-09-14T12:47:46+00:00

779

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

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

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

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

Total Answers 2

26

Answers 1 : of PHP script to calculate code128

Try: http://barcode-coder.com/en/barcode-php-class-203.html

Or if you are using PEAR you can use anycodings_code128 http://pear.php.net/package/Image_Barcode2

And there is anycodings_code128 http://www.brandonchecketts.com/archives/quick-php-script-to-generate-a-barcode anycodings_code128 and also http://www.barcodebakery.com/en

0

2022-09-14T12:47:46+00:00 2022-09-14T12:47:46+00:00Answer Link

mRahman

3

Answers 2 : of PHP script to calculate code128

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

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

0

2022-09-14T12:47:46+00:00 2022-09-14T12:47:46+00:00Answer Link

miraj

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Î".

  • php
  • barcode
  • code128

asked Jul 19, 2012 at 22:55

MilanMilan

8872 gold badges15 silver badges32 bronze badges

2 Answers

Sorted by: Reset to default

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

Hbgl php code 128 encoder

zeeMonkeez

4,9573 gold badges30 silver badges51 bronze badges

answered Jul 19, 2012 at 23:05

cegfaultcegfault

6,3193 gold badges25 silver badges49 bronze badges

3

  • I didn't want to down vote your answer :( It might be useful. I will check tomorrow. It told me that I can vote again if you modify your answer.

    Jul 19, 2012 at 23:33

  • You can "un-downvote" my answer by clicking the down arrow again. And are you trying to generate a barcode image, parse a barcode image to read it's string value, or transform a string into code128? That was unclear. But, all three should be answered in my links.

    Jul 19, 2012 at 23:36

  • You last voted on this answer 6 hours ago Your vote is now locked in unless this answer is edited (click on this box to dismiss) I can't undo it :( My intention was to transform string into code128.

    Jul 20, 2012 at 5:51

Hbgl php code 128 encoder

ouflak

2,42810 gold badges41 silver badges48 bronze badges

answered Sep 7, 2021 at 10:08

Hbgl php code 128 encoder