• Stars
    star
    250
  • Rank 162,397 (Top 4 %)
  • Language
    PHP
  • License
    Other
  • Created over 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PHP library to generate linear and bidimensional barcodes

tc-lib-barcode

PHP barcode library

Latest Stable Version Master Build Status Master Coverage Status License Total Downloads

Donate via PayPal Please consider supporting this project by making a donation via PayPal

Description

This library includes utility PHP classes to generate linear and bidimensional barcodes:

  • C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9
  • C39+ : CODE 39 with checksum
  • C39E : CODE 39 EXTENDED
  • C39E+ : CODE 39 EXTENDED + CHECKSUM
  • C93 : CODE 93 - USS-93
  • S25 : Standard 2 of 5
  • S25+ : Standard 2 of 5 + CHECKSUM
  • I25 : Interleaved 2 of 5
  • I25+ : Interleaved 2 of 5 + CHECKSUM
  • C128 : CODE 128
  • C128A : CODE 128 A
  • C128B : CODE 128 B
  • C128C : CODE 128 C
  • EAN2 : 2-Digits UPC-Based Extension
  • EAN5 : 5-Digits UPC-Based Extension
  • EAN8 : EAN 8
  • EAN13 : EAN 13
  • UPCA : UPC-A
  • UPCE : UPC-E
  • MSI : MSI (Variation of Plessey code)
  • MSI+ : MSI + CHECKSUM (modulo 11)
  • POSTNET : POSTNET
  • PLANET : PLANET
  • RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
  • KIX : KIX (Klant index - Customer index)
  • IMB : IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
  • IMBPRE : IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200- pre-processed
  • CODABAR : CODABAR
  • CODE11 : CODE 11
  • PHARMA : PHARMACODE
  • PHARMA2T : PHARMACODE TWO-TRACKS
  • DATAMATRIX : DATAMATRIX (ISO/IEC 16022)
  • PDF417 : PDF417 (ISO/IEC 15438:2006)
  • QRCODE : QR-CODE
  • RAW : 2D RAW MODE comma-separated rows
  • RAW2 : 2D RAW MODE rows enclosed in square parentheses

Output Formats

  • PNG Image
  • SVG Image
  • HTML DIV
  • Unicode String
  • Binary String

The initial source code has been derived from TCPDF.

Getting started

First, you need to install all development dependencies using Composer:

$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer

This project include a Makefile that allows you to test and build the project with simple commands. To see all available options:

make help

To install all the development dependencies:

make deps

Running all tests

Before committing the code, please check if it passes all tests using

make qa

All artifacts are generated in the target directory.

Examples

Examples are located in the example directory.

Start a development server (requires PHP 5.4) using the command:

make server

and point your browser to http://localhost:8000/index.php

Simple Code Example

Please check example/index.php for a full example.

// instantiate the barcode class
$barcode = new \Com\Tecnick\Barcode\Barcode();

// generate a barcode
$bobj = $barcode->getBarcodeObj(
    'QRCODE,H',                     // barcode type and additional comma-separated parameters
    'https://tecnick.com',          // data string to encode
    -4,                             // bar width (use absolute or negative value as multiplication factor)
    -4,                             // bar height (use absolute or negative value as multiplication factor)
    'black',                        // foreground color
    array(-2, -2, -2, -2)           // padding (use absolute or negative values as multiplication factors)
    )->setBackgroundColor('white'); // background color

// output the barcode as HTML div (see other output formats in the documentation and examples)
echo $bobj->getHtmlDiv();

Installation

Create a composer.json in your projects root-directory:

{
    "require": {
        "tecnickcom/tc-lib-barcode": "^1.17"
    }
}

Or add to an existing project with:

composer require tecnickcom/tc-lib-barcode ^1.17

Packaging

This library is mainly intended to be used and included in other PHP projects using Composer. However, since some production environments dictates the installation of any application as RPM or DEB packages, this library includes make targets for building these packages (make rpm and make deb). The packages are generated under the target directory.

When this library is installed using an RPM or DEB package, you can use it your code by including the autoloader:

require_once ('/usr/share/php/Com/Tecnick/Barcode/autoload.php');

Developer(s) Contact

More Repositories

1

TCPDF

Official clone of PHP library to generate PDF documents and barcodes
PHP
3,809
star
2

tc-lib-pdf

TCPDF - PHP PDF Library - https://tcpdf.org
PHP
1,433
star
3

tcexam

TCExam is a CBA (Computer-Based Assessment) system (e-exam, CBT - Computer Based Testing) for universities, schools and companies, that enables educators and trainers to author, schedule, deliver, and report on surveys, quizzes, tests and exams.
PHP
516
star
4

alldev

Dockerfile to build a generic development environment based on Ubuntu Linux
Dockerfile
41
star
5

tc-lib-pdf-parser

PHP library to parse PDF documents
PHP
26
star
6

inedi

iNEDI (improved New Edge-Directed Interpolation) Image Zooming Algorithm
MATLAB
25
star
7

tc-lib-color

PHP library to manipulate various color representations
PHP
21
star
8

gogen

Command-line tool to generate GO applications and libraries
Go
18
star
9

tc-lib-pdf-font

PHP library containing PDF font methods and utilities
PHP
17
star
10

tc-lib-unicode

PHP library containing Unicode methods
PHP
10
star
11

pygen

Command-line tool to generate Python applications and libraries
Python
8
star
12

web-cctray

Web-based dashboard for CI/CD cctray.xml files
JavaScript
7
star
13

tc-lib-pdf-encrypt

PHP library to encrypt data for PDF documents
PHP
7
star
14

tc-lib-file

PHP library to read byte-level data from files
PHP
7
star
15

rndpwd

Command line and Web Service Random Password Generator written in GO
Go
7
star
16

tc-lib-pdf-filter

PHP library to decode PDF compression and encryption filters
PHP
6
star
17

binsearch

Search unsigned integers in sorted binary file
C
6
star
18

tc-lib-pdf-page

PHP library containing PDF page formats and definitions
PHP
6
star
19

edgetools

Matlab tools to find edges of a digital image
MATLAB
6
star
20

tc-lib-pdf-image

PHP library containing PDF Image methods
PHP
6
star
21

farmhash64

farmhash64 is a portable C99 64-bit hash function
Go
6
star
22

tc-lib-unicode-data

PHP library containing UTF-8 font definitions
PHP
5
star
23

tc-lib-pdf-graph

PHP library containing PDF graphic and geometric methods
PHP
5
star
24

ServerUsage

The ServerUsage system is designed to collect and process statistic information from computers running a GNU-Linux Operating System.
C
3
star
25

demo-srv-idp

Multi-container demo of srv-idp (SAML Identity Provider Service for ZFA-SSO)
PHP
3
star
26

tc-font-mirror

Mirror for several OpenSource Fonts
PostScript
3
star
27

tc-font-pdfa

Type1 core fonts for PDF/A
PostScript
3
star
28

wordfreq

Parse an input file and return the most frequently used words with their frequency.
C
2
star
29

test

test
2
star
30

go-xsd-pkg

Go wrappers for various XML formats
Go
2
star
31

rgen

Command-line tool to generate R projects
Makefile
2
star
32

unitmulti

Convert base unit values to multiples and submultiples
Python
2
star
33

docker-php-saml

Dockerfile for onelogin/php-saml
Makefile
2
star
34

natsping

NATS Bus Test Component
Go
2
star
35

LogPipe

PHP module to extend the default PHP error handling function.
C
2
star
36

tc-lib-testrest

Library to test end-to-end RESTful services using Behat
PHP
2
star
37

archive-sourceforge-nicolaasuni

Historic SourceForge archive of old open source projects by Nicola Asuni
PHP
2
star
38

tc-font-core14-afms

Adobe Postscript(R) Core 14 AFM Files
2
star
39

variantkey

Numerical Encoding for Human Genetic Variants and Regions
C
2
star
40

natstest

NATS Bus Functional Test Component
Go
2
star
41

rpistat

Web-Service to collect system usage statistics
Go
1
star