You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+48-10Lines changed: 48 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,10 @@ This is an easy to use, non-bloated, framework independent, barcode generator in
5
5
6
6
It creates SVG, PNG, JPG and HTML images, from the most used 1D barcode standards.
7
7
8
-
*The codebase is largely from the [TCPDF barcode generator](https://github.com/tecnickcom/TCPDF) by Nicola Asuni. This code is therefor licensed under LGPLv3.*
8
+
*The codebase is based on the [TCPDF barcode generator](https://github.com/tecnickcom/TCPDF) by Nicola Asuni. This code is therefor licensed under LGPLv3.*
9
+
10
+
## No support for...
11
+
We do not support any 2D barcodes, like QR codes. We also only generate the 'bars' part of a barcode. If you want text of the code below the barcode, you could add it later to the output of this package.
9
12
10
13
## Installation
11
14
Install through [composer](https://getcomposer.org/doc/00-intro.md):
@@ -20,16 +23,31 @@ If you want to generate PNG or JPG images, you need the GD library or Imagick in
20
23
Initiate the barcode generator for the output you want, then call the ->getBarcode() routine as many times as you want.
21
24
22
25
```php
26
+
<?php
27
+
require 'vendor/autoload.php';
28
+
29
+
// This will output the barcode as HTML output to display in the browser
23
30
$generator = new Picqer\Barcode\BarcodeGeneratorHTML();
@@ -39,7 +57,11 @@ $generatorJPG = new Picqer\Barcode\BarcodeGeneratorJPG();
39
57
$generatorHTML = new Picqer\Barcode\BarcodeGeneratorHTML();
40
58
```
41
59
42
-
## Accepted types
60
+
## Accepted barcode types
61
+
These barcode types are supported. All types support different character sets or have mandatory lengths. Please see wikipedia for supported chars and lengths per type.
62
+
63
+
Most used types are TYPE_CODE_128 and TYPE_CODE_39. Because of the best scanner support, variable length and most chars supported.
64
+
43
65
- TYPE_CODE_39
44
66
- TYPE_CODE_39_CHECKSUM
45
67
- TYPE_CODE_39E
@@ -73,10 +95,26 @@ $generatorHTML = new Picqer\Barcode\BarcodeGeneratorHTML();
73
95
74
96
[See example images for all supported barcode types](examples.md)
75
97
98
+
## A note about PNG and JPG images
99
+
If you want to use PNG or JPG images, you need to install [Imagick](https://www.php.net/manual/en/intro.imagick.php) or the [GD library](https://www.php.net/manual/en/intro.image.php). This package will use Imagick if that is installed, or fall back to GD. If you have both installed but you want a specific method, you can use `$generator->useGd()` or `$generator->useImagick()` to force your preference.
100
+
101
+
We use Imagick as standard because the size of the output is factor 10 smaller.
102
+
76
103
## Examples
77
-
Embedded PNG image in HTML:
78
104
105
+
### Embedded PNG image in HTML
79
106
```php
80
-
$generator = new \Picqer\Barcode\BarcodeGeneratorPNG();
107
+
$generator = new Picqer\Barcode\BarcodeGeneratorPNG();
0 commit comments