dolibarr
x.y.z
|
Set of functions used for barcode generation (internal lib, also code 'phpbarcode') More...
Go to the source code of this file.
Functions | |
if(!empty($conf->global->GENBARCODE_LOCATION)) | barcode_print ($code, $encoding="ANY", $scale=2, $mode="png") |
Print barcode. More... | |
barcode_encode ($code, $encoding) | |
Encodes $code with $encoding using genbarcode OR built-in encoder if you don't have genbarcode only EAN-13/ISBN or UPC is possible. More... | |
barcode_gen_ean_sum ($ean) | |
Calculate EAN sum. More... | |
barcode_gen_ean_bars ($ean) | |
Generate EAN bars. More... | |
barcode_encode_ean ($ean, $encoding="EAN-13") | |
Encode EAN. More... | |
barcode_encode_upc ($upc, $encoding="UPC") | |
Encode UPC. More... | |
barcode_encode_genbarcode ($code, $encoding) | |
Encode result of genbarcode command. More... | |
barcode_outimage ($text, $bars, $scale=1, $mode="png", $total_y=0, $space='') | |
Output image onto standard output, or onto disk if global filebarcode is defined. More... | |
Set of functions used for barcode generation (internal lib, also code 'phpbarcode')
Definition in file barcode.lib.php.
barcode_encode | ( | $code, | |
$encoding | |||
) |
Encodes $code with $encoding using genbarcode OR built-in encoder if you don't have genbarcode only EAN-13/ISBN or UPC is possible.
You can use the following encodings (when you have genbarcode): ANY choose best-fit (default) EAN 8 or 13 EAN-Code UPC 12-digit EAN ISBN isbn numbers (still EAN-13) 39 code 39 128 code 128 (a,b,c: autoselection) 128C code 128 (compact form for digits) 128B code 128, full printable ascii I25 interleaved 2 of 5 (only digits) 128RAW Raw code 128 (by Leonid A. Broukhis) CBR Codabar (by Leonid A. Broukhis) MSI MSI (by Leonid A. Broukhis) PLS Plessey (by Leonid A. Broukhis)
string | $code | Code |
string | $encoding | Encoding |
Definition at line 127 of file barcode.lib.php.
barcode_encode_ean | ( | $ean, | |
$encoding = "EAN-13" |
|||
) |
Encode EAN.
string | $ean | Code |
string | $encoding | Encoding |
Definition at line 229 of file barcode.lib.php.
barcode_encode_genbarcode | ( | $code, | |
$encoding | |||
) |
Encode result of genbarcode command.
string | $code | Code |
string | $encoding | Encoding |
Definition at line 335 of file barcode.lib.php.
barcode_encode_upc | ( | $upc, | |
$encoding = "UPC" |
|||
) |
Encode UPC.
string | $upc | Code |
string | $encoding | Encoding |
Definition at line 285 of file barcode.lib.php.
barcode_gen_ean_bars | ( | $ean | ) |
Generate EAN bars.
string | $ean | EAN to encode |
Definition at line 199 of file barcode.lib.php.
barcode_gen_ean_sum | ( | $ean | ) |
Calculate EAN sum.
string | $ean | EAN to encode |
Definition at line 175 of file barcode.lib.php.
barcode_outimage | ( | $text, | |
$bars, | |||
$scale = 1 , |
|||
$mode = "png" , |
|||
$total_y = 0 , |
|||
$space = '' |
|||
) |
Output image onto standard output, or onto disk if global filebarcode is defined.
string | $text | the text-line (<position>:<font-size>:<character> ...) |
string | $bars | where to place the bars (<space-width><bar-width><space-width><bar-width>...) |
int | $scale | scale factor ( 1 < scale < unlimited (scale 50 will produce 5400x300 pixels when using EAN-13!!!)) |
string | $mode | png,gif,jpg (default='png') |
int | $total_y | the total height of the image ( default: scale * 60 ) |
array | $space | default: $space[top] = 2 * $scale; $space[bottom]= 2 * $scale; $space[left] = 2 * $scale; $space[right] = 2 * $scale; |
Definition at line 403 of file barcode.lib.php.
if (!empty( $conf->global->GENBARCODE_LOCATION)) barcode_print | ( | $code, | |
$encoding = "ANY" , |
|||
$scale = 2 , |
|||
$mode = "png" |
|||
) |
Print barcode.
string | $code | Code |
string | $encoding | Encoding ('EAN13', 'ISBN', 'C128', 'UPC', 'CBR', 'QRCODE', 'DATAMATRIX', 'ANY'...) |
integer | $scale | Scale |
string | $mode | 'png' or 'jpg' ... |
Definition at line 80 of file barcode.lib.php.