28 require_once(
'tcpdf_include.php');
35 $pdf->SetAuthor(
'Nicola Asuni');
36 $pdf->SetTitle(
'TCPDF Example 050');
37 $pdf->SetSubject(
'TCPDF Tutorial');
38 $pdf->SetKeywords(
'TCPDF, PDF, example, test, guide');
62 if (@file_exists(dirname(__FILE__).
'/lang/eng.php')) {
63 require_once(dirname(__FILE__).
'/lang/eng.php');
64 $pdf->setLanguageArray(
$l);
72 $pdf->SetFont(
'helvetica',
'', 11);
78 $txt =
"You can also export 2D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcode directory.\n";
79 $pdf->MultiCell(70, 50,
$txt, 0,
'J',
false, 1, 125, 30,
true, 0,
false,
true, 0,
'T',
false);
82 $pdf->SetFont(
'helvetica',
'', 10);
91 'fgcolor' =>
array(0,0,0),
99 $code =
'111011101110111,010010001000010,010011001110010,010010000010010,010011101110010';
103 $code =
'[111011101110111][010010001000010][010011001110010][010010000010010][010011101110010]';
111 'vpadding' =>
'auto',
112 'hpadding' =>
'auto',
113 'fgcolor' =>
array(0,0,0),
120 $pdf->write2DBarcode(
'www.tcpdf.org',
'QRCODE,L', 20, 30, 50, 50,
$style,
'N');
121 $pdf->Text(20, 25,
'QRCODE L');
124 $pdf->write2DBarcode(
'www.tcpdf.org',
'QRCODE,M', 20, 90, 50, 50,
$style,
'N');
125 $pdf->Text(20, 85,
'QRCODE M');
128 $pdf->write2DBarcode(
'www.tcpdf.org',
'QRCODE,Q', 20, 150, 50, 50,
$style,
'N');
129 $pdf->Text(20, 145,
'QRCODE Q');
132 $pdf->write2DBarcode(
'www.tcpdf.org',
'QRCODE,H', 20, 210, 50, 50,
$style,
'N');
133 $pdf->Text(20, 205,
'QRCODE H');
168 $pdf->write2DBarcode(
'www.tcpdf.org',
'PDF417', 80, 90, 0, 30,
$style,
'N');
169 $pdf->Text(80, 85,
'PDF417 (ISO/IEC 15438:2006)');
174 $pdf->write2DBarcode(
'http://www.tcpdf.org',
'DATAMATRIX', 80, 150, 50, 50,
$style,
'N');
175 $pdf->Text(80, 145,
'DATAMATRIX (ISO/IEC 16022:2006)');
183 'fgcolor' =>
array(0,0,255),
184 'bgcolor' =>
array(255,255,64)
188 $pdf->write2DBarcode(
'www.tcpdf.org',
'QRCODE,H', 80, 210, 50, 50,
$style,
'N');
189 $pdf->Text(80, 205,
'QRCODE H - COLORED');
195 'fgcolor' =>
array(128,0,0),
200 $pdf->write2DBarcode(
'www.tcpdf.org',
'QRCODE,H', 140, 210, 50, 50,
$style,
'N');
201 $pdf->Text(140, 205,
'QRCODE H - NO PADDING');
206 $pdf->Output(
'example_050.pdf',
'I');
const PDF_MARGIN_BOTTOM
Bottom margin.
const PDF_MARGIN_LEFT
Left margin.
const PDF_MARGIN_HEADER
Header margin.
const PDF_HEADER_STRING
Header description string.
const PDF_FONT_SIZE_MAIN
Default main font size.
const PDF_FONT_SIZE_DATA
Default data font size.
const PDF_FONT_NAME_MAIN
Default main font name.
PHP class for generating PDF documents without requiring external extensions.
const PDF_HEADER_LOGO_WIDTH
Header logo image width in user units.
const PDF_HEADER_LOGO
Deafult image logo used be the default Header() method.
const PDF_UNIT
Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
const PDF_IMAGE_SCALE_RATIO
Ratio used to adjust the conversion of pixels to user units.
const PDF_PAGE_ORIENTATION
Page orientation (P=portrait, L=landscape).
Create styles array
The data for the language used.
const PDF_MARGIN_RIGHT
Right margin.
const PDF_HEADER_TITLE
Header title.
const PDF_FONT_NAME_DATA
Default data font name.
const PDF_CREATOR
Document creator.
const PDF_PAGE_FORMAT
Page format.
const PDF_FONT_MONOSPACED
Default monospaced font name.
const PDF_MARGIN_TOP
Top margin.
const PDF_MARGIN_FOOTER
Footer margin.