Created
February 26, 2018 07:26
-
-
Save evilnapsis/c741349c809f726f975d0bad5728c67e to your computer and use it in GitHub Desktop.
generar codigo de barras con PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('class/BCGFontFile.php'); | |
require_once('class/BCGColor.php'); | |
require_once('class/BCGDrawing.php'); | |
require_once('class/BCGcode128.barcode.php'); | |
header('Content-Type: image/png'); | |
$colorFront = new BCGColor(0, 0, 0); | |
$colorBack = new BCGColor(255, 255, 255); | |
$code = new BCGcode128(); | |
$code->setScale(4); | |
$code->setThickness(30); | |
$code->setForegroundColor($colorFront); | |
$code->setBackgroundColor($colorBack); | |
$code->parse('http://evilnapsis.com/'); | |
$drawing = new BCGDrawing('', $colorBack); | |
$drawing->setBarcode($code); | |
$drawing->draw(); | |
$drawing->finish(BCGDrawing::IMG_FORMAT_PNG); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment