28 require_once(
'tcpdf_include.php');
35 $pdf->SetAuthor(
'Nicola Asuni');
36 $pdf->SetTitle(
'TCPDF Example 027');
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);
70 $pdf->setBarcode(
date(
'Y-m-d H:i:s'));
73 $pdf->SetFont(
'helvetica',
'', 11);
79 $txt =
"You can also export 1D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcodes directory.\n";
80 $pdf->MultiCell(70, 50,
$txt, 0,
'J',
false, 1, 125, 30,
true, 0,
false,
true, 0,
'T',
false);
85 $pdf->SetFont(
'helvetica',
'', 10);
97 'fgcolor' =>
array(0,0,0),
100 'font' =>
'helvetica',
108 $pdf->Cell(0, 0,
'CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9', 0, 1);
109 $pdf->write1DBarcode(
'CODE 39',
'C39',
'',
'',
'', 18, 0.4,
$style,
'N');
114 $pdf->Cell(0, 0,
'CODE 39 + CHECKSUM', 0, 1);
115 $pdf->write1DBarcode(
'CODE 39 +',
'C39+',
'',
'',
'', 18, 0.4,
$style,
'N');
120 $pdf->Cell(0, 0,
'CODE 39 EXTENDED', 0, 1);
121 $pdf->write1DBarcode(
'CODE 39 E',
'C39E',
'',
'',
'', 18, 0.4,
$style,
'N');
126 $pdf->Cell(0, 0,
'CODE 39 EXTENDED + CHECKSUM', 0, 1);
127 $pdf->write1DBarcode(
'CODE 39 E+',
'C39E+',
'',
'',
'', 18, 0.4,
$style,
'N');
132 $pdf->Cell(0, 0,
'CODE 93 - USS-93', 0, 1);
133 $pdf->write1DBarcode(
'TEST93',
'C93',
'',
'',
'', 18, 0.4,
$style,
'N');
138 $pdf->Cell(0, 0,
'Standard 2 of 5', 0, 1);
139 $pdf->write1DBarcode(
'1234567',
'S25',
'',
'',
'', 18, 0.4,
$style,
'N');
144 $pdf->Cell(0, 0,
'Standard 2 of 5 + CHECKSUM', 0, 1);
145 $pdf->write1DBarcode(
'1234567',
'S25+',
'',
'',
'', 18, 0.4,
$style,
'N');
150 $pdf->Cell(0, 0,
'Interleaved 2 of 5', 0, 1);
151 $pdf->write1DBarcode(
'1234567',
'I25',
'',
'',
'', 18, 0.4,
$style,
'N');
156 $pdf->Cell(0, 0,
'Interleaved 2 of 5 + CHECKSUM', 0, 1);
157 $pdf->write1DBarcode(
'1234567',
'I25+',
'',
'',
'', 18, 0.4,
$style,
'N');
164 $pdf->Cell(0, 0,
'CODE 128 AUTO', 0, 1);
165 $pdf->write1DBarcode(
'CODE 128 AUTO',
'C128',
'',
'',
'', 18, 0.4,
$style,
'N');
170 $pdf->Cell(0, 0,
'CODE 128 A', 0, 1);
171 $pdf->write1DBarcode(
'CODE 128 A',
'C128A',
'',
'',
'', 18, 0.4,
$style,
'N');
176 $pdf->Cell(0, 0,
'CODE 128 B', 0, 1);
177 $pdf->write1DBarcode(
'CODE 128 B',
'C128B',
'',
'',
'', 18, 0.4,
$style,
'N');
182 $pdf->Cell(0, 0,
'CODE 128 C', 0, 1);
183 $pdf->write1DBarcode(
'0123456789',
'C128C',
'',
'',
'', 18, 0.4,
$style,
'N');
188 $pdf->Cell(0, 0,
'EAN 8', 0, 1);
189 $pdf->write1DBarcode(
'1234567',
'EAN8',
'',
'',
'', 18, 0.4,
$style,
'N');
194 $pdf->Cell(0, 0,
'EAN 13', 0, 1);
195 $pdf->write1DBarcode(
'1234567890128',
'EAN13',
'',
'',
'', 18, 0.4,
$style,
'N');
200 $pdf->Cell(0, 0,
'UPC-A', 0, 1);
201 $pdf->write1DBarcode(
'12345678901',
'UPCA',
'',
'',
'', 18, 0.4,
$style,
'N');
206 $pdf->Cell(0, 0,
'UPC-E', 0, 1);
207 $pdf->write1DBarcode(
'04210000526',
'UPCE',
'',
'',
'', 18, 0.4,
$style,
'N');
213 $pdf->Cell(0, 0,
'5-Digits UPC-Based Extension', 0, 1);
214 $pdf->write1DBarcode(
'51234',
'EAN5',
'',
'',
'', 18, 0.4,
$style,
'N');
219 $pdf->Cell(0, 0,
'2-Digits UPC-Based Extension', 0, 1);
220 $pdf->write1DBarcode(
'34',
'EAN2',
'',
'',
'', 18, 0.4,
$style,
'N');
225 $pdf->Cell(0, 0,
'MSI', 0, 1);
226 $pdf->write1DBarcode(
'80523',
'MSI',
'',
'',
'', 18, 0.4,
$style,
'N');
231 $pdf->Cell(0, 0,
'MSI + CHECKSUM (module 11)', 0, 1);
232 $pdf->write1DBarcode(
'80523',
'MSI+',
'',
'',
'', 18, 0.4,
$style,
'N');
237 $pdf->Cell(0, 0,
'CODABAR', 0, 1);
238 $pdf->write1DBarcode(
'123456789',
'CODABAR',
'',
'',
'', 18, 0.4,
$style,
'N');
243 $pdf->Cell(0, 0,
'CODE 11', 0, 1);
244 $pdf->write1DBarcode(
'123-456-789',
'CODE11',
'',
'',
'', 18, 0.4,
$style,
'N');
249 $pdf->Cell(0, 0,
'PHARMACODE', 0, 1);
250 $pdf->write1DBarcode(
'789',
'PHARMA',
'',
'',
'', 18, 0.4,
$style,
'N');
255 $pdf->Cell(0, 0,
'PHARMACODE TWO-TRACKS', 0, 1);
256 $pdf->write1DBarcode(
'105',
'PHARMA2T',
'',
'',
'', 18, 2,
$style,
'N');
262 $pdf->Cell(0, 0,
'IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200', 0, 1);
263 $pdf->write1DBarcode(
'01234567094987654321-01234567891',
'IMB',
'',
'',
'', 15, 0.6,
$style,
'N');
268 $pdf->Cell(0, 0,
'POSTNET', 0, 1);
269 $pdf->write1DBarcode(
'98000',
'POSTNET',
'',
'',
'', 15, 0.6,
$style,
'N');
274 $pdf->Cell(0, 0,
'PLANET', 0, 1);
275 $pdf->write1DBarcode(
'98000',
'PLANET',
'',
'',
'', 15, 0.6,
$style,
'N');
280 $pdf->Cell(0, 0,
'RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)', 0, 1);
281 $pdf->write1DBarcode(
'SN34RD1A',
'RMS4CC',
'',
'',
'', 15, 0.6,
$style,
'N');
286 $pdf->Cell(0, 0,
'KIX (Klant index - Customer index)', 0, 1);
287 $pdf->write1DBarcode(
'SN34RDX1A',
'KIX',
'',
'',
'', 15, 0.6,
$style,
'N');
301 $pdf->write1DBarcode(
'LEFT',
'C128A',
'',
'',
'', 15, 0.4,
$style,
'N');
307 $pdf->write1DBarcode(
'CENTER',
'C128A',
'',
'',
'', 15, 0.4,
$style,
'N');
313 $pdf->write1DBarcode(
'RIGHT',
'C128A',
'',
'',
'', 15, 0.4,
$style,
'N');
325 $pdf->write1DBarcode(
'LEFT',
'C128A',
'',
'',
'', 15, 0.4,
$style,
'N');
331 $pdf->write1DBarcode(
'CENTER',
'C128A',
'',
'',
'', 15, 0.4,
$style,
'N');
337 $pdf->write1DBarcode(
'RIGHT',
'C128A',
'',
'',
'', 15, 0.4,
$style,
'N');
349 $pdf->write1DBarcode(
'LEFT',
'C128A', 105,
'', 90, 15, 0.4,
$style,
'N');
355 $pdf->write1DBarcode(
'CENTER',
'C128A', 105,
'', 90, 15, 0.4,
$style,
'N');
361 $pdf->write1DBarcode(
'RIGHT',
'C128A', 105,
'', 90, 15, 0.4,
$style,
'N');
370 $pdf->write1DBarcode(
'LEFT',
'C128A',
'',
'',
'', 15, 0.4,
$style,
'N');
376 $pdf->write1DBarcode(
'CENTER',
'C128A',
'',
'',
'', 15, 0.4,
$style,
'N');
382 $pdf->write1DBarcode(
'RIGHT',
'C128A',
'',
'',
'', 15, 0.4,
$style,
'N');
393 'cellfitalign' =>
'',
395 'hpadding' =>
'auto',
396 'vpadding' =>
'auto',
397 'fgcolor' =>
array(0,0,128),
398 'bgcolor' =>
array(255,255,128),
400 'label' =>
'CUSTOM LABEL',
401 'font' =>
'helvetica',
407 $pdf->Cell(0, 0,
'CODE 39 EXTENDED + CHECKSUM', 0, 1);
408 $pdf->SetLineStyle(
array(
'width' => 1,
'cap' =>
'butt',
'join' =>
'miter',
'dash' => 0,
'color' =>
array(255, 0, 0)));
409 $pdf->write1DBarcode(
'CODE 39 E+',
'C39E+',
'',
'', 120, 25, 0.4,
$style,
'N');
414 $pdf->Output(
'example_027.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.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
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.