TCPDF::write1DBarcode( $code,  $type,  $x = '',  $y = '',  $w = '',  $h = '',  $xres = '',  $style = array(),  $align = '' )

Print a Linear Barcode.


Description Description


Parameters Parameters

$code

(Required) (string) code to print

$type

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

$x

(Optional) (int) x position in user units (empty string = current x position)

Default value: ''

$y

(Optional) (int) y position in user units (empty string = current y position)

Default value: ''

$w

(Optional) (int) width in user units (empty string = remaining page width)

Default value: ''

$h

(Optional) (int) height in user units (empty string = remaining page height)

Default value: ''

$xres

(Optional) (float) width of the smallest bar in user units (empty string = default value = 0.4mm)

Default value: ''

$style

(Optional) (array) array of options:<ul> <li>boolean $style['border'] if true prints a border</li> <li>int $style['padding'] padding to leave around the barcode in user units (set to 'auto' for automatic padding)</li> <li>int $style['hpadding'] horizontal padding in user units (set to 'auto' for automatic padding)</li> <li>int $style['vpadding'] vertical padding in user units (set to 'auto' for automatic padding)</li> <li>array $style['fgcolor'] color array for bars and text</li> <li>mixed $style['bgcolor'] color array for background (set to false for transparent)</li> <li>boolean $style['text'] if true prints text below the barcode</li> <li>string $style['label'] override default label</li> <li>string $style['font'] font name for text</li><li>int $style['fontsize'] font size for text</li> <li>int $style['stretchtext']: 0 = disabled; 1 = horizontal scaling only if necessary; 2 = forced horizontal scaling; 3 = character spacing only if necessary; 4 = forced character spacing.</li> <li>string $style['position'] horizontal position of the containing barcode cell on the page: L = left margin; C = center; R = right margin.</li> <li>string $style['align'] horizontal position of the barcode on the containing rectangle: L = left; C = center; R = right.</li> <li>string $style['stretch'] if true stretch the barcode to best fit the available width, otherwise uses $xres resolution for a single bar.</li> <li>string $style['fitwidth'] if true reduce the width to fit the barcode width + padding. When this option is enabled the 'stretch' option is automatically disabled.</li> <li>string $style['cellfitalign'] this option works only when 'fitwidth' is true and 'position' is unset or empty. Set the horizontal position of the containing barcode cell inside the specified rectangle: L = left; C = center; R = right.</li></ul>

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: ''


Top ↑

Source Source

File: includes/lib/tcpdf/tcpdf.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
3.1.000 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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