TCPDF::write2DBarcode( $code,  $type,  $x = '',  $y = '',  $w = '',  $h = '',  $style = array(),  $align = '',  $distort = false )

Print 2D Barcode.


Description Description


Parameters Parameters

$code

(Required) (string) code to print

$type

(Required) (string) type of barcode (see tcpdf_barcodes_2d.php for supported formats).

$x

(Optional) (int) x position in user units

Default value: ''

$y

(Optional) (int) y position in user units

Default value: ''

$w

(Optional) (int) width in user units

Default value: ''

$h

(Optional) (int) height in user units

Default value: ''

$style

(Optional) (array) array of options:<ul> <li>boolean $style['border'] if true prints a border around the barcode</li> <li>int $style['padding'] padding to leave around the barcode in barcode units (set to 'auto' for automatic padding)</li> <li>int $style['hpadding'] horizontal padding in barcode units (set to 'auto' for automatic padding)</li> <li>int $style['vpadding'] vertical padding in barcode units (set to 'auto' for automatic padding)</li> <li>int $style['module_width'] width of a single module in points</li> <li>int $style['module_height'] height of a single module in points</li> <li>array $style['fgcolor'] color array for bars and text</li> <li>mixed $style['bgcolor'] color array for background or false for transparent</li> <li>string $style['position'] barcode position on the page: L = left margin; C = center; R = right margin; S = stretch</li>

Default value: array()

$align

(Optional) (string) Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:<ul><li>T: top-right for LTR or top-left for RTL</li><li>M: middle-right for LTR or middle-left for RTL</li><li>B: bottom-right for LTR or bottom-left for RTL</li><li>N: next line</li></ul>

Default value: ''

$distort

(Optional) (boolean) if true distort the barcode to fit width and height, otherwise preserve aspect ratio

Default value: false


Top ↑

Source Source

File: includes/lib/tcpdf/tcpdf.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
4.5.037 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.