From 100fb961484c3d5f96ed47e11b6dd8c93b744911 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 3 Jun 2016 14:42:20 +0100 Subject: [PATCH] added the example files, they will not installed to Joomla --- examples/barcodes/example_1d_html.php | 53 + examples/barcodes/example_1d_png.php | 53 + examples/barcodes/example_1d_svg.php | 53 + examples/barcodes/example_1d_svgi.php | 53 + .../barcodes/example_2d_datamatrix_html.php | 53 + .../barcodes/example_2d_datamatrix_png.php | 53 + .../barcodes/example_2d_datamatrix_svg.php | 53 + .../barcodes/example_2d_datamatrix_svgi.php | 53 + examples/barcodes/example_2d_pdf417_html.php | 53 + examples/barcodes/example_2d_pdf417_png.php | 53 + examples/barcodes/example_2d_pdf417_svg.php | 53 + examples/barcodes/example_2d_pdf417_svgi.php | 53 + examples/barcodes/example_2d_qrcode_html.php | 53 + examples/barcodes/example_2d_qrcode_png.php | 53 + examples/barcodes/example_2d_qrcode_svg.php | 53 + examples/barcodes/example_2d_qrcode_svgi.php | 53 + .../barcodes/tcpdf_barcodes_1d_include.php | 37 + .../barcodes/tcpdf_barcodes_2d_include.php | 37 + examples/config/tcpdf_config_alt.php | 222 +++ examples/data/cert/tcpdf.crt | 40 + examples/data/cert/tcpdf.fdf | Bin 0 -> 1286 bytes examples/data/cert/tcpdf.p12 | Bin 0 -> 1749 bytes examples/data/chapter_demo_1.txt | 19 + examples/data/chapter_demo_2.txt | 23 + examples/data/table_data_demo.txt | 15 + examples/data/utf8test.txt | 128 ++ examples/example_001.php | 106 ++ examples/example_002.php | 87 + examples/example_003.php | 118 ++ examples/example_004.php | 121 ++ examples/example_005.php | 158 ++ examples/example_006.php | 330 ++++ examples/example_007.php | 113 ++ examples/example_008.php | 97 ++ examples/example_009.php | 146 ++ examples/example_010.php | 150 ++ examples/example_011.php | 138 ++ examples/example_012.pdf | Bin 0 -> 13214 bytes examples/example_012.php | 205 +++ examples/example_013.php | 229 +++ examples/example_014.php | 194 +++ examples/example_015.php | 161 ++ examples/example_016.php | 134 ++ examples/example_017.php | 117 ++ examples/example_018.php | 128 ++ examples/example_019.php | 98 ++ examples/example_020.php | 146 ++ examples/example_021.php | 91 + examples/example_022.php | 146 ++ examples/example_023.php | 113 ++ examples/example_024.php | 140 ++ examples/example_025.php | 118 ++ examples/example_026.php | 145 ++ examples/example_027.php | 418 +++++ examples/example_028.php | 138 ++ examples/example_029.php | 124 ++ examples/example_030.php | 188 +++ examples/example_031.php | 103 ++ examples/example_032.php | 91 + examples/example_033.php | 105 ++ examples/example_034.php | 96 ++ examples/example_035.php | 111 ++ examples/example_036.php | 89 + examples/example_037.php | 147 ++ examples/example_038.php | 92 + examples/example_039.php | 104 ++ examples/example_040.php | 116 ++ examples/example_041.php | 90 + examples/example_042.php | 102 ++ examples/example_043.php | 85 + examples/example_044.php | 128 ++ examples/example_045.php | 140 ++ examples/example_046.php | 123 ++ examples/example_047.php | 117 ++ examples/example_048.php | 313 ++++ examples/example_049.php | 126 ++ examples/example_050.php | 210 +++ examples/example_051.php | 145 ++ examples/example_052.php | 121 ++ examples/example_053.php | 108 ++ examples/example_054.php | 128 ++ examples/example_055.php | 115 ++ examples/example_056.php | 133 ++ examples/example_057.php | 268 +++ examples/example_058.php | 94 ++ examples/example_059.php | 190 +++ examples/example_060.php | 108 ++ examples/example_061.php | 264 +++ examples/example_062.php | 140 ++ examples/example_063.php | 131 ++ examples/example_064.php | 176 ++ examples/example_065.php | 98 ++ examples/images/_blank.png | Bin 0 -> 137 bytes examples/images/alpha.png | Bin 0 -> 23886 bytes examples/images/image_demo.jpg | Bin 0 -> 573845 bytes examples/images/image_with_alpha.png | Bin 0 -> 244218 bytes examples/images/img.png | Bin 0 -> 195148 bytes examples/images/logo_example.gif | Bin 0 -> 21022 bytes examples/images/logo_example.jpg | Bin 0 -> 32732 bytes examples/images/logo_example.png | Bin 0 -> 19411 bytes examples/images/tcpdf_box.ai | 214 +++ examples/images/tcpdf_box.svg | 69 + examples/images/tcpdf_cell.png | Bin 0 -> 38415 bytes examples/images/tcpdf_logo.jpg | Bin 0 -> 17633 bytes examples/images/tcpdf_signature.png | Bin 0 -> 67931 bytes examples/images/testsvg.svg | 328 ++++ examples/images/tux.svg | 1487 +++++++++++++++++ examples/index.php | 115 ++ examples/lang/afr.php | 44 + examples/lang/ara.php | 44 + examples/lang/aze.php | 44 + examples/lang/bel.php | 44 + examples/lang/bra.php | 44 + examples/lang/bul.php | 44 + examples/lang/cat.php | 44 + examples/lang/ces.php | 44 + examples/lang/chi.php | 44 + examples/lang/cym.php | 44 + examples/lang/dan.php | 44 + examples/lang/eng.php | 44 + examples/lang/est.php | 44 + examples/lang/eus.php | 44 + examples/lang/far.php | 44 + examples/lang/fra.php | 44 + examples/lang/ger.php | 44 + examples/lang/gle.php | 44 + examples/lang/glg.php | 44 + examples/lang/hat.php | 44 + examples/lang/heb.php | 44 + examples/lang/hrv.php | 44 + examples/lang/hun.php | 44 + examples/lang/hye.php | 44 + examples/lang/ind.php | 44 + examples/lang/ita.php | 44 + examples/lang/jpn.php | 44 + examples/lang/kat.php | 44 + examples/lang/kor.php | 44 + examples/lang/mkd.php | 44 + examples/lang/mlt.php | 44 + examples/lang/msa.php | 44 + examples/lang/nld.php | 44 + examples/lang/nob.php | 44 + examples/lang/pol.php | 44 + examples/lang/por.php | 44 + examples/lang/ron.php | 44 + examples/lang/rus.php | 44 + examples/lang/slv.php | 44 + examples/lang/spa.php | 44 + examples/lang/sqi.php | 44 + examples/lang/srp.php | 44 + examples/lang/swa.php | 44 + examples/lang/swe.php | 44 + examples/lang/ukr.php | 44 + examples/lang/urd.php | 44 + examples/lang/yid.php | 44 + examples/lang/zho.php | 44 + examples/tcpdf_include.php | 48 + 157 files changed, 15046 insertions(+) create mode 100644 examples/barcodes/example_1d_html.php create mode 100644 examples/barcodes/example_1d_png.php create mode 100644 examples/barcodes/example_1d_svg.php create mode 100644 examples/barcodes/example_1d_svgi.php create mode 100644 examples/barcodes/example_2d_datamatrix_html.php create mode 100644 examples/barcodes/example_2d_datamatrix_png.php create mode 100644 examples/barcodes/example_2d_datamatrix_svg.php create mode 100644 examples/barcodes/example_2d_datamatrix_svgi.php create mode 100644 examples/barcodes/example_2d_pdf417_html.php create mode 100644 examples/barcodes/example_2d_pdf417_png.php create mode 100644 examples/barcodes/example_2d_pdf417_svg.php create mode 100644 examples/barcodes/example_2d_pdf417_svgi.php create mode 100644 examples/barcodes/example_2d_qrcode_html.php create mode 100644 examples/barcodes/example_2d_qrcode_png.php create mode 100644 examples/barcodes/example_2d_qrcode_svg.php create mode 100644 examples/barcodes/example_2d_qrcode_svgi.php create mode 100644 examples/barcodes/tcpdf_barcodes_1d_include.php create mode 100644 examples/barcodes/tcpdf_barcodes_2d_include.php create mode 100644 examples/config/tcpdf_config_alt.php create mode 100644 examples/data/cert/tcpdf.crt create mode 100644 examples/data/cert/tcpdf.fdf create mode 100644 examples/data/cert/tcpdf.p12 create mode 100644 examples/data/chapter_demo_1.txt create mode 100644 examples/data/chapter_demo_2.txt create mode 100644 examples/data/table_data_demo.txt create mode 100644 examples/data/utf8test.txt create mode 100755 examples/example_001.php create mode 100755 examples/example_002.php create mode 100755 examples/example_003.php create mode 100755 examples/example_004.php create mode 100755 examples/example_005.php create mode 100755 examples/example_006.php create mode 100755 examples/example_007.php create mode 100755 examples/example_008.php create mode 100755 examples/example_009.php create mode 100755 examples/example_010.php create mode 100755 examples/example_011.php create mode 100644 examples/example_012.pdf create mode 100755 examples/example_012.php create mode 100755 examples/example_013.php create mode 100755 examples/example_014.php create mode 100755 examples/example_015.php create mode 100755 examples/example_016.php create mode 100755 examples/example_017.php create mode 100755 examples/example_018.php create mode 100755 examples/example_019.php create mode 100755 examples/example_020.php create mode 100755 examples/example_021.php create mode 100755 examples/example_022.php create mode 100755 examples/example_023.php create mode 100755 examples/example_024.php create mode 100755 examples/example_025.php create mode 100755 examples/example_026.php create mode 100755 examples/example_027.php create mode 100755 examples/example_028.php create mode 100755 examples/example_029.php create mode 100755 examples/example_030.php create mode 100755 examples/example_031.php create mode 100755 examples/example_032.php create mode 100755 examples/example_033.php create mode 100755 examples/example_034.php create mode 100755 examples/example_035.php create mode 100755 examples/example_036.php create mode 100755 examples/example_037.php create mode 100755 examples/example_038.php create mode 100755 examples/example_039.php create mode 100755 examples/example_040.php create mode 100755 examples/example_041.php create mode 100755 examples/example_042.php create mode 100755 examples/example_043.php create mode 100755 examples/example_044.php create mode 100755 examples/example_045.php create mode 100755 examples/example_046.php create mode 100755 examples/example_047.php create mode 100755 examples/example_048.php create mode 100755 examples/example_049.php create mode 100755 examples/example_050.php create mode 100755 examples/example_051.php create mode 100755 examples/example_052.php create mode 100755 examples/example_053.php create mode 100755 examples/example_054.php create mode 100755 examples/example_055.php create mode 100755 examples/example_056.php create mode 100755 examples/example_057.php create mode 100755 examples/example_058.php create mode 100755 examples/example_059.php create mode 100755 examples/example_060.php create mode 100755 examples/example_061.php create mode 100755 examples/example_062.php create mode 100755 examples/example_063.php create mode 100755 examples/example_064.php create mode 100755 examples/example_065.php create mode 100644 examples/images/_blank.png create mode 100644 examples/images/alpha.png create mode 100644 examples/images/image_demo.jpg create mode 100644 examples/images/image_with_alpha.png create mode 100644 examples/images/img.png create mode 100644 examples/images/logo_example.gif create mode 100644 examples/images/logo_example.jpg create mode 100644 examples/images/logo_example.png create mode 100644 examples/images/tcpdf_box.ai create mode 100644 examples/images/tcpdf_box.svg create mode 100644 examples/images/tcpdf_cell.png create mode 100644 examples/images/tcpdf_logo.jpg create mode 100644 examples/images/tcpdf_signature.png create mode 100644 examples/images/testsvg.svg create mode 100644 examples/images/tux.svg create mode 100755 examples/index.php create mode 100644 examples/lang/afr.php create mode 100644 examples/lang/ara.php create mode 100644 examples/lang/aze.php create mode 100644 examples/lang/bel.php create mode 100644 examples/lang/bra.php create mode 100644 examples/lang/bul.php create mode 100644 examples/lang/cat.php create mode 100644 examples/lang/ces.php create mode 100644 examples/lang/chi.php create mode 100644 examples/lang/cym.php create mode 100644 examples/lang/dan.php create mode 100644 examples/lang/eng.php create mode 100644 examples/lang/est.php create mode 100644 examples/lang/eus.php create mode 100644 examples/lang/far.php create mode 100644 examples/lang/fra.php create mode 100644 examples/lang/ger.php create mode 100644 examples/lang/gle.php create mode 100644 examples/lang/glg.php create mode 100644 examples/lang/hat.php create mode 100644 examples/lang/heb.php create mode 100644 examples/lang/hrv.php create mode 100644 examples/lang/hun.php create mode 100644 examples/lang/hye.php create mode 100644 examples/lang/ind.php create mode 100644 examples/lang/ita.php create mode 100644 examples/lang/jpn.php create mode 100644 examples/lang/kat.php create mode 100644 examples/lang/kor.php create mode 100644 examples/lang/mkd.php create mode 100644 examples/lang/mlt.php create mode 100644 examples/lang/msa.php create mode 100644 examples/lang/nld.php create mode 100644 examples/lang/nob.php create mode 100644 examples/lang/pol.php create mode 100644 examples/lang/por.php create mode 100644 examples/lang/ron.php create mode 100644 examples/lang/rus.php create mode 100644 examples/lang/slv.php create mode 100644 examples/lang/spa.php create mode 100644 examples/lang/sqi.php create mode 100644 examples/lang/srp.php create mode 100644 examples/lang/swa.php create mode 100644 examples/lang/swe.php create mode 100644 examples/lang/ukr.php create mode 100644 examples/lang/urd.php create mode 100644 examples/lang/yid.php create mode 100644 examples/lang/zho.php create mode 100644 examples/tcpdf_include.php diff --git a/examples/barcodes/example_1d_html.php b/examples/barcodes/example_1d_html.php new file mode 100644 index 0000000..67d22e7 --- /dev/null +++ b/examples/barcodes/example_1d_html.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.000 + */ + +// include 1D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128'); + +// output the barcode as HTML object +echo $barcodeobj->getBarcodeHTML(2, 30, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_1d_png.php b/examples/barcodes/example_1d_png.php new file mode 100644 index 0000000..9e44909 --- /dev/null +++ b/examples/barcodes/example_1d_png.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.000 + */ + +// include 1D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128'); + +// output the barcode as PNG image +$barcodeobj->getBarcodePNG(2, 30, array(0,0,0)); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_1d_svg.php b/examples/barcodes/example_1d_svg.php new file mode 100644 index 0000000..f7b585a --- /dev/null +++ b/examples/barcodes/example_1d_svg.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.000 + */ + +// include 1D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128'); + +// output the barcode as SVG image +$barcodeobj->getBarcodeSVG(2, 30, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_1d_svgi.php b/examples/barcodes/example_1d_svgi.php new file mode 100644 index 0000000..a74a304 --- /dev/null +++ b/examples/barcodes/example_1d_svgi.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.000 + */ + +// include 1D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128'); + +// output the barcode as SVG inline code +echo $barcodeobj->getBarcodeSVGcode(2, 40, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_datamatrix_html.php b/examples/barcodes/example_2d_datamatrix_html.php new file mode 100644 index 0000000..dc7bab3 --- /dev/null +++ b/examples/barcodes/example_2d_datamatrix_html.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'DATAMATRIX'); + +// output the barcode as HTML object +echo $barcodeobj->getBarcodeHTML(6, 6, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_datamatrix_png.php b/examples/barcodes/example_2d_datamatrix_png.php new file mode 100644 index 0000000..87b7a33 --- /dev/null +++ b/examples/barcodes/example_2d_datamatrix_png.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'DATAMATRIX'); + +// output the barcode as PNG image +$barcodeobj->getBarcodePNG(6, 6, array(0,0,0)); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_datamatrix_svg.php b/examples/barcodes/example_2d_datamatrix_svg.php new file mode 100644 index 0000000..523ebfa --- /dev/null +++ b/examples/barcodes/example_2d_datamatrix_svg.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'DATAMATRIX'); + +// output the barcode as SVG image +$barcodeobj->getBarcodeSVG(6, 6, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_datamatrix_svgi.php b/examples/barcodes/example_2d_datamatrix_svgi.php new file mode 100644 index 0000000..4470981 --- /dev/null +++ b/examples/barcodes/example_2d_datamatrix_svgi.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'DATAMATRIX'); + +// output the barcode as SVG inline code +echo $barcodeobj->getBarcodeSVGcode(6, 6, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_pdf417_html.php b/examples/barcodes/example_2d_pdf417_html.php new file mode 100644 index 0000000..4c4e9ee --- /dev/null +++ b/examples/barcodes/example_2d_pdf417_html.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417'); + +// output the barcode as HTML object +echo $barcodeobj->getBarcodeHTML(4, 4, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_pdf417_png.php b/examples/barcodes/example_2d_pdf417_png.php new file mode 100644 index 0000000..df939bb --- /dev/null +++ b/examples/barcodes/example_2d_pdf417_png.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417'); + +// output the barcode as PNG image +$barcodeobj->getBarcodePNG(4, 4, array(0,0,0)); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_pdf417_svg.php b/examples/barcodes/example_2d_pdf417_svg.php new file mode 100644 index 0000000..fb29ea2 --- /dev/null +++ b/examples/barcodes/example_2d_pdf417_svg.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417'); + +// output the barcode as SVG image +$barcodeobj->getBarcodeSVG(4, 4, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_pdf417_svgi.php b/examples/barcodes/example_2d_pdf417_svgi.php new file mode 100644 index 0000000..94e1c71 --- /dev/null +++ b/examples/barcodes/example_2d_pdf417_svgi.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417'); + +// output the barcode as SVG inline code +echo $barcodeobj->getBarcodeSVGcode(4, 4, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_qrcode_html.php b/examples/barcodes/example_2d_qrcode_html.php new file mode 100644 index 0000000..ac828f7 --- /dev/null +++ b/examples/barcodes/example_2d_qrcode_html.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H'); + +// output the barcode as HTML object +echo $barcodeobj->getBarcodeHTML(6, 6, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_qrcode_png.php b/examples/barcodes/example_2d_qrcode_png.php new file mode 100644 index 0000000..71f8710 --- /dev/null +++ b/examples/barcodes/example_2d_qrcode_png.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H'); + +// output the barcode as PNG image +$barcodeobj->getBarcodePNG(6, 6, array(0,0,0)); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_qrcode_svg.php b/examples/barcodes/example_2d_qrcode_svg.php new file mode 100644 index 0000000..1baa43d --- /dev/null +++ b/examples/barcodes/example_2d_qrcode_svg.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H'); + +// output the barcode as SVG image +$barcodeobj->getBarcodeSVG(6, 6, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/example_2d_qrcode_svgi.php b/examples/barcodes/example_2d_qrcode_svgi.php new file mode 100644 index 0000000..99d6590 --- /dev/null +++ b/examples/barcodes/example_2d_qrcode_svgi.php @@ -0,0 +1,53 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Example for tcpdf_barcodes_2d.php class +// +//============================================================+ + +/** + * @file + * Example for tcpdf_barcodes_2d.php class + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.009 + */ + +// include 2D barcode class (search for installation path) +require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php'); + +// set the barcode content and type +$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H'); + +// output the barcode as SVG inline code +echo $barcodeobj->getBarcodeSVGcode(6, 6, 'black'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/barcodes/tcpdf_barcodes_1d_include.php b/examples/barcodes/tcpdf_barcodes_1d_include.php new file mode 100644 index 0000000..a0bde57 --- /dev/null +++ b/examples/barcodes/tcpdf_barcodes_1d_include.php @@ -0,0 +1,37 @@ +. +// +// See LICENSE.TXT file for more information. +//============================================================+ + +/** + * Example of alternative configuration file for TCPDF. + * @author Nicola Asuni + * @package com.tecnick.tcpdf + * @version 4.9.005 + * @since 2004-10-27 + */ + +/** + * Define the following constant to ignore the default configuration file. + */ +define ('K_TCPDF_EXTERNAL_CONFIG', true); + +/** + * Installation path (/var/www/tcpdf/). + * By default it is automatically calculated but you can also set it as a fixed string to improve performances. + */ +//define ('K_PATH_MAIN', ''); + +/** + * URL path to tcpdf installation folder (http://localhost/tcpdf/). + * By default it is automatically set but you can also set it as a fixed string to improve performances. + */ +//define ('K_PATH_URL', ''); + +/** + * Path for PDF fonts. + * By default it is automatically set but you can also set it as a fixed string to improve performances. + */ +//define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/'); + +/** + * Default images directory. + * By default it is automatically set but you can also set it as a fixed string to improve performances. + */ +define ('K_PATH_IMAGES', dirname(__FILE__).'/../images/'); + +/** + * Deafult image logo used be the default Header() method. + * Please set here your own logo or an empty string to disable it. + */ +define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg'); + +/** + * Header logo image width in user units. + */ +define ('PDF_HEADER_LOGO_WIDTH', 30); + +/** + * Cache directory for temporary files (full path). + */ +define ('K_PATH_CACHE', sys_get_temp_dir().'/'); + +/** + * Generic name for a blank image. + */ +define ('K_BLANK_IMAGE', '_blank.png'); + +/** + * Page format. + */ +define ('PDF_PAGE_FORMAT', 'A4'); + +/** + * Page orientation (P=portrait, L=landscape). + */ +define ('PDF_PAGE_ORIENTATION', 'P'); + +/** + * Document creator. + */ +define ('PDF_CREATOR', 'TCPDF'); + +/** + * Document author. + */ +define ('PDF_AUTHOR', 'TCPDF'); + +/** + * Header title. + */ +define ('PDF_HEADER_TITLE', 'TCPDF Example'); + +/** + * Header description string. + */ +define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); + +/** + * Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]. + */ +define ('PDF_UNIT', 'mm'); + +/** + * Header margin. + */ +define ('PDF_MARGIN_HEADER', 5); + +/** + * Footer margin. + */ +define ('PDF_MARGIN_FOOTER', 10); + +/** + * Top margin. + */ +define ('PDF_MARGIN_TOP', 27); + +/** + * Bottom margin. + */ +define ('PDF_MARGIN_BOTTOM', 25); + +/** + * Left margin. + */ +define ('PDF_MARGIN_LEFT', 15); + +/** + * Right margin. + */ +define ('PDF_MARGIN_RIGHT', 15); + +/** + * Default main font name. + */ +define ('PDF_FONT_NAME_MAIN', 'helvetica'); + +/** + * Default main font size. + */ +define ('PDF_FONT_SIZE_MAIN', 10); + +/** + * Default data font name. + */ +define ('PDF_FONT_NAME_DATA', 'helvetica'); + +/** + * Default data font size. + */ +define ('PDF_FONT_SIZE_DATA', 8); + +/** + * Default monospaced font name. + */ +define ('PDF_FONT_MONOSPACED', 'courier'); + +/** + * Ratio used to adjust the conversion of pixels to user units. + */ +define ('PDF_IMAGE_SCALE_RATIO', 1.25); + +/** + * Magnification factor for titles. + */ +define('HEAD_MAGNIFICATION', 1.1); + +/** + * Height of cell respect font height. + */ +define('K_CELL_HEIGHT_RATIO', 1.25); + +/** + * Title magnification respect main font size. + */ +define('K_TITLE_MAGNIFICATION', 1.3); + +/** + * Reduction factor for small font. + */ +define('K_SMALL_RATIO', 2/3); + +/** + * Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language. + */ +define('K_THAI_TOPCHARS', true); + +/** + * If true allows to call TCPDF methods using HTML syntax + * IMPORTANT: For security reason, disable this feature if you are printing user HTML content. + */ +define('K_TCPDF_CALLS_IN_HTML', true); + +/** + * If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution. + */ +define('K_TCPDF_THROW_EXCEPTION_ERROR', false); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/data/cert/tcpdf.crt b/examples/data/cert/tcpdf.crt new file mode 100644 index 0000000..f049139 --- /dev/null +++ b/examples/data/cert/tcpdf.crt @@ -0,0 +1,40 @@ +Bag Attributes + localKeyID: 7B AB 1B 7A BE 4C 85 C0 1A A6 DC 59 3F 79 48 C3 93 38 68 9C +subject=/CN=TCPDF DEMO/O=TCPDF/OU=DEMO/emailAddress=you@example.com/C=IT +issuer=/CN=TCPDF DEMO/O=TCPDF/OU=DEMO/emailAddress=you@example.com/C=IT +-----BEGIN CERTIFICATE----- +MIIC1TCCAj6gAwIBAgIKkehOL/XGkB5cjjANBgkqhkiG9w0BAQUFADBhMRMwEQYD +VQQDEwpUQ1BERiBERU1PMQ4wDAYDVQQKEwVUQ1BERjENMAsGA1UECxMEREVNTzEe +MBwGCSqGSIb3DQEJARYPeW91QGV4YW1wbGUuY29tMQswCQYDVQQGEwJJVDAeFw0w +OTA4MjExMjU0NDhaFw0xNDA4MjExMjU0NDhaMGExEzARBgNVBAMTClRDUERGIERF +TU8xDjAMBgNVBAoTBVRDUERGMQ0wCwYDVQQLEwRERU1PMR4wHAYJKoZIhvcNAQkB +Fg95b3VAZXhhbXBsZS5jb20xCzAJBgNVBAYTAklUMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDAqIL0uGKmTR98Lxx2vEEE1OGKkMXFo0JViitALe7Onhxxqx0H +XMUDKF5mvEVu1rcvh7/oAnAfrCuEpL/up3u1mQCgBE7WXBnFFE/AE3jCksh9OkS0 +Z0Xj9woN5bzxRDsGoPiOu/4xzk5qSEXt8jf2Ep90QuNkqLIRT4swAzpDbwIDAQAB +o4GTMIGQMDcGA1UdEgQwMC6gEQYDVQQDDApUQ1BERiBERU1PoAwGA1UECgwFVENQ +REagCwYDVQQLDARERU1PMDcGA1UdEQQwMC6gEQYDVQQDDApUQ1BERiBERU1PoAwG +A1UECgwFVENQREagCwYDVQQLDARERU1PMA8GCSqGSIb3LwEBCgQCBQAwCwYDVR0P +BAQDAgSQMA0GCSqGSIb3DQEBBQUAA4GBAEhTQfqX3ZNdHmpTLDbIj22RHXii2roE +OavCbu9WsHoWpva0qSd+yIoD594VHvYAd29sfzDfiN+7W0aiZfDhq5jpaSQMVlN8 +RGYMupbHY/+a9Gz1wqxnR84mlTtIkZVRYAhsfPwy6M1BEjdMqfdh9h40JIdkdjtb +8faTCfXPePWQ +-----END CERTIFICATE----- +Bag Attributes + localKeyID: 7B AB 1B 7A BE 4C 85 C0 1A A6 DC 59 3F 79 48 C3 93 38 68 9C +Key Attributes: +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDAqIL0uGKmTR98Lxx2vEEE1OGKkMXFo0JViitALe7Onhxxqx0H +XMUDKF5mvEVu1rcvh7/oAnAfrCuEpL/up3u1mQCgBE7WXBnFFE/AE3jCksh9OkS0 +Z0Xj9woN5bzxRDsGoPiOu/4xzk5qSEXt8jf2Ep90QuNkqLIRT4swAzpDbwIDAQAB +AoGAXc+wNMmz/5Z+RlIKYia44klmqbplEx+0JULqXI4BQsrqvs67i+I4bJkznoL+ +rEIRYSuQ3sCRKFsFtckjTGpxadnxkB+uwGKc6pZChv99BFX6HFR4hgBlT/BBRAQA +hMDlM2JIRr4S4SMVXR7MHwGMUf9mUeanGLR3ZWtU3aXJrIECQQD7OaYUVYNEEnM9 +uXyjm22CuHyqyEf5gb13sK0uQty67547yJTMUQZd/sQc9KGwhzBbhrob2LO2jAhh +S+f+NSRnAkEAxFHm3fMI5RgXmswxlGm4QW07a/Ueo7ZJG6xjTkFXluJhd+XHswRD +dQIO3zG9nGjNUoeMrPhXhPvKqFc2F9RDuQJAQBEGin74N77gxqfr4ik79y8nE8J5 +oGZ2s/RJZdfFRKLg3mwbjjNHhWb4Ck5UgZkoOt8TzRApXG8/n9hktE5HFwJBALur +M5AueO1Pl5kB489lNJ9OxUQRYUXMxpxuscuoCQwSwmv0O2+0/qtG2WKhUQnI4aYo +L+FV0YwtivBb1jj3T/kCQQDIWOxq8eRowdaMzvJpRUHFgMcf1AVZExKyrugwYOWd +KNsDxC4KaQOsPt8iT/Ulo4g/MJC0HolCOhWibKmR9Ayl +-----END RSA PRIVATE KEY----- diff --git a/examples/data/cert/tcpdf.fdf b/examples/data/cert/tcpdf.fdf new file mode 100644 index 0000000000000000000000000000000000000000..a8f7c35d9af83d2579adafbe8d2745daa30dfd3f GIT binary patch literal 1286 zcmY#&b8*u()HC8$ef0SJWnL~r1p|frq%2+=8-1XRf)S7#r0=WYVr67tU}<1sWNK(+ zVqj{ZZD6EsV4$w4A5vM6s_&dwl9-d9ZfD1vnwJ974blcRB_P0C!5Cx;LKeh@%DVa{ zX69&A=9fC8RwU*YU-uEiZ?;rfP&Z2LK)A;_B7r3kke!oRl4_NlT2$g%0n&r%SOWtqBSU91S93#0P5mGRLt{e&OJj)R zfezFUQ!unNGcz$2Stmap^>SHiA5BUZ)k$Vr=CM% zc=0=>aXxA&FtRc*H}*0ZG&u@?wgf?)m6q&9>l2-|l~g=lrrfT;F~&|0XoQ#OZO$icNz4 z-3H87&iPEtj0}v68z&nyPB1VB2BNGGi-CdO0!TdZAji`JXe{wSVrc;=ieh+KxOu>l z1ko%=ie|W0erW9KGcv~Hu`mIX3dn3(eijyHCYA}PK?qDp%)qeo2zLB6{qE#gxvXFv zvlIQf6J;wF-P*-sx%yDv`>+jFV#~g5S*c!kqKo)Yp8S8-mz=MM)}*_iQ=4k-F>z{O0!L2GAEOs%9fiz&R(?FEV{qfsm&adYyzE04L)pyR%D@jZ)LCJsMoDa#P`pJ37QixnsQIwj-%VnTo z3MAk_!OYau*i-=|0R@I;3SgE(9zx6lQ_K*HIwK1Mgx-=OU}=(C#LERNy@E5VQWZ?~ kgYxrB6hMU zY-rcU0s;sCfPw=!#BpZA(3DXgvNT6SMx2c3M^p9_<~*qj&~k|Wio#7(scRd zVB;~P(%~|g!$#H)Uj>}ly*mK-K*NcRU+dxygiF7$BDFu;YqjVO#_{qT;h+#I>a(HG z6~@vJ%56(B0~rm^94uG!F&Q6%9$*+cPTn~18aH}n`p;SwVUc3}cGnJV33D`@$5Df5 zka5G^;jy@bF*5dt7yj?!On2m{6(lU}`+Ngz(u>-st&u3q&_N{T-$B(t9@HplX>tLm z<+%6V-nXIed*8 zvh$I?cs-H$tTFYyLYOK&N@y0$j3(wM=r+RHOFm_l_Ew3J zjZ|cTFZc?kMLbIRq9#Je0!uHg$!6L_|JSTh4SBDC^kz-4Q$rl0exLwuv7)I*(A$u( z4~P;V(@gR1lQvQ9WUL5F(7#Oi)Yh-}TXhqUaHvL^;{PKZ_!c^5TIaYzP~~Y~ol!Ix zIU5LwA?E0d=I<-Og-X;m1K5(@AtP)n6jQ1{Q2ko=_)Bd{1(bAXe>Coeda=}lih)j$ z2>zQNzJ;fmRdBanq`^ZJV5@Ra+72~oPcmiLf=NHQP1lj<)-k#CXYR9X=4kR3k!;Y8h(}v0#D@^oeB!oK*4q{yIW*$U z&LNQUbi3jQQ0AALA`*I zEfwAUX0Q~1Fi>8l{3I2b+YV;2v~q$Ht)BfYyxTJvSQ3SoAxX}JT3QHXqu~l@W;f&? zvySO921ne7{yT!I)^oWbM&abJwv8?L zM@*J>12l+CQ;QV!Y|w=vINzLD8!z3$e&b>m;bngGpZYK)8EI}digPEz z`_pvC6Afky&Q2vvrHY~v?ZeFbT?m+rp=p=tij1id`L#ceB43YATh$S6RuVfPIPHzQGmAuP1O9==9r!_9t z(XXtxXOZ1gWS49JT5NEHFG{7{?SuzHx8kV3=tHXcRlJ=U+G!T)+ z?jrd2IhsLxK1dcI7Bz#699SwDG5!;?5@oG>vkAutIB1uG5% r0vZJX1QaJKFP)8IPAOWT%X#|+d4hgQWoQHlY+QLorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.

+ + + +

Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.

+ +

Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu.

+ +

Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra.

+ +

Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat.

+ +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.

+ + + +

Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.

+ +

Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu.

+ +

Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra.

+ +

Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat.

diff --git a/examples/data/table_data_demo.txt b/examples/data/table_data_demo.txt new file mode 100644 index 0000000..5a48a42 --- /dev/null +++ b/examples/data/table_data_demo.txt @@ -0,0 +1,15 @@ +Austria;Vienna;83859;8075 +Belgium;Brussels;30518;10192 +Denmark;Copenhagen;43094;5295 +Finland;Helsinki;304529;5147 +France;Paris;543965;58728 +Germany;Berlin;357022;82057 +Greece;Athens;131625;10511 +Ireland;Dublin;70723;3694 +Italy;Roma;301316;57563 +Luxembourg;Luxembourg;2586;424 +Netherlands;Amsterdam;41526;15654 +Portugal;Lisbon;91906;9957 +Spain;Madrid;504790;39348 +Sweden;Stockholm;410934;8839 +United Kingdom;London;243820;58862 diff --git a/examples/data/utf8test.txt b/examples/data/utf8test.txt new file mode 100644 index 0000000..291d4e7 --- /dev/null +++ b/examples/data/utf8test.txt @@ -0,0 +1,128 @@ +Sentences that contain all letters commonly used in a language +-------------------------------------------------------------- + +This file is UTF-8 encoded. + +Czech (cz) +--------- + + Příšerně žluťoučký kůň úpěl ďábelské ódy. + Hleď, toť přízračný kůň v mátožné póze šíleně úpí. + Zvlášť zákeřný učeň s ďolíčky běží podél zóny úlů. + Loď čeří kýlem tůň obzvlášť v Grónské úžině. + Ó, náhlý déšť již zvířil prach a čilá laň teď běží s houfcem gazel k úkrytům. + +Danish (da) +--------- + + Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen + Wolther spillede på xylofon. + (= Quiz contestants were eating strawbery with cream while Wolther + the circus clown played on xylophone.) + +German (de) +----------- + + Falsches Üben von Xylophonmusik quält jeden größeren Zwerg + (= Wrongful practicing of xylophone music tortures every larger dwarf) + + Zwölf Boxkämpfer jagten Eva quer über den Sylter Deich + (= Twelve boxing fighters hunted Eva across the dike of Sylt) + + Heizölrückstoßabdämpfung + (= fuel oil recoil absorber) + (jqvwxy missing, but all non-ASCII letters in one word) + +English (en) +------------ + + The quick brown fox jumps over the lazy dog + +Spanish (es) +------------ + + El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y + frío, añoraba a su querido cachorro. + (Contains every letter and every accent, but not every combination + of vowel + acute.) + +French (fr) +----------- + + Portez ce vieux whisky au juge blond qui fume sur son île intérieure, à + côté de l'alcôve ovoïde, où les bûches se consument dans l'âtre, ce + qui lui permet de penser à la cænogenèse de l'être dont il est question + dans la cause ambiguë entendue à Moÿ, dans un capharnaüm qui, + pense-t-il, diminue çà et là la qualité de son œuvre. + + l'île exiguë + Où l'obèse jury mûr + Fête l'haï volapük, + Âne ex aéquo au whist, + Ôtez ce vœu déçu. + + Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en + canoë au delà des îles, près du mälström où brûlent les novæ. + +Irish Gaelic (ga) +----------------- + + D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh + +Hungarian (hu) +-------------- + + Árvíztűrő tükörfúrógép + (= flood-proof mirror-drilling machine, only all non-ASCII letters) + +Icelandic (is) +-------------- + + Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa + + Sævör grét áðan því úlpan var ónýt + (some ASCII letters missing) + +Greek (el) +------------- + + Γαζέες καὶ μυρτιὲς δὲν θὰ βρῶ πιὰ στὸ χρυσαφὶ ξέφωτο + (= No more shall I see acacias or myrtles in the golden clearing) + + Ξεσκεπάζω τὴν ψυχοφθόρα βδελυγμία + (= I uncover the soul-destroying abhorrence) + +Hebrew (iw) +----------- + + ? דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה + +Polish (pl) +----------- + + Pchnąć w tę łódź jeża lub osiem skrzyń fig + (= To push a hedgehog or eight bins of figs in this boat) + + Zażółć gęślą jaźń + +Russian (ru) +------------ + + В чащах юга жил бы цитрус? Да, но фальшивый экземпляр! + (= Would a citrus live in the bushes of south? Yes, but only a fake one!) + +Thai (th) +--------- + + [--------------------------|------------------------] + ๏ เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน + จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร + ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัดอภัยเหมือนกีฬาอัชฌาสัย + ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอย ฯ + + [The copyright for the Thai example is owned by The Computer + Association of Thailand under the Royal Patronage of His Majesty the + King.] + +Please let me know if you find others! Special thanks to the people +from all over the world who contributed these sentences. diff --git a/examples/example_001.php b/examples/example_001.php new file mode 100755 index 0000000..055c66a --- /dev/null +++ b/examples/example_001.php @@ -0,0 +1,106 @@ +SetCreator(PDF_CREATOR); +$pdf->SetAuthor('Nicola Asuni'); +$pdf->SetTitle('TCPDF Example 001'); +$pdf->SetSubject('TCPDF Tutorial'); +$pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + +// set default header data +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128)); +$pdf->setFooterData(array(0,64,0), array(0,64,128)); + +// set header and footer fonts +$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); +$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font +$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +// set margins +$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); +$pdf->SetHeaderMargin(PDF_MARGIN_HEADER); +$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + +// set auto page breaks +$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +// set image scale factor +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +// set some language-dependent strings (optional) +if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { + require_once(dirname(__FILE__).'/lang/eng.php'); + $pdf->setLanguageArray($l); +} + +// --------------------------------------------------------- + +// set default font subsetting mode +$pdf->setFontSubsetting(true); + +// Set font +// dejavusans is a UTF-8 Unicode font, if you only need to +// print standard ASCII chars, you can use core fonts like +// helvetica or times to reduce file size. +$pdf->SetFont('dejavusans', '', 14, '', true); + +// Add a page +// This method has several options, check the source code documentation for more information. +$pdf->AddPage(); + +// set text shadow effect +$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal')); + +// Set some content to print +$html = <<Welcome to  TCPDF ! +This is the first example of TCPDF library. +

This text is printed using the writeHTMLCell() method but you can also use: Multicell(), writeHTML(), Write(), Cell() and Text().

+

Please check the source code documentation and other examples for further information.

+

TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE MAKE A DONATION!

+EOD; + +// Print text using writeHTMLCell() +$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); + +// --------------------------------------------------------- + +// Close and output PDF document +// This method has several options, check the source code documentation for more information. +$pdf->Output('example_001.pdf', 'I'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/example_002.php b/examples/example_002.php new file mode 100755 index 0000000..020dd29 --- /dev/null +++ b/examples/example_002.php @@ -0,0 +1,87 @@ +SetCreator(PDF_CREATOR); +$pdf->SetAuthor('Nicola Asuni'); +$pdf->SetTitle('TCPDF Example 002'); +$pdf->SetSubject('TCPDF Tutorial'); +$pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + +// remove default header/footer +$pdf->setPrintHeader(false); +$pdf->setPrintFooter(false); + +// set default monospaced font +$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +// set margins +$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); + +// set auto page breaks +$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +// set image scale factor +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +// set some language-dependent strings (optional) +if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { + require_once(dirname(__FILE__).'/lang/eng.php'); + $pdf->setLanguageArray($l); +} + +// --------------------------------------------------------- + +// set font +$pdf->SetFont('times', 'BI', 20); + +// add a page +$pdf->AddPage(); + +// set some text to print +$txt = <<Write(0, $txt, '', 0, 'C', true, 0, false, false, 0); + +// --------------------------------------------------------- + +//Close and output PDF document +$pdf->Output('example_002.pdf', 'I'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/example_003.php b/examples/example_003.php new file mode 100755 index 0000000..73a0e8c --- /dev/null +++ b/examples/example_003.php @@ -0,0 +1,118 @@ +Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false); + // Set font + $this->SetFont('helvetica', 'B', 20); + // Title + $this->Cell(0, 15, '<< TCPDF Example 003 >>', 0, false, 'C', 0, '', 0, false, 'M', 'M'); + } + + // Page footer + public function Footer() { + // Position at 15 mm from bottom + $this->SetY(-15); + // Set font + $this->SetFont('helvetica', 'I', 8); + // Page number + $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M'); + } +} + +// create new PDF document +$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); + +// set document information +$pdf->SetCreator(PDF_CREATOR); +$pdf->SetAuthor('Nicola Asuni'); +$pdf->SetTitle('TCPDF Example 003'); +$pdf->SetSubject('TCPDF Tutorial'); +$pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + +// set default header data +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); + +// set header and footer fonts +$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); +$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font +$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +// set margins +$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); +$pdf->SetHeaderMargin(PDF_MARGIN_HEADER); +$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + +// set auto page breaks +$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +// set image scale factor +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +// set some language-dependent strings (optional) +if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { + require_once(dirname(__FILE__).'/lang/eng.php'); + $pdf->setLanguageArray($l); +} + +// --------------------------------------------------------- + +// set font +$pdf->SetFont('times', 'BI', 12); + +// add a page +$pdf->AddPage(); + +// set some text to print +$txt = <<Write(0, $txt, '', 0, 'C', true, 0, false, false, 0); + +// --------------------------------------------------------- + +//Close and output PDF document +$pdf->Output('example_003.pdf', 'I'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/example_004.php b/examples/example_004.php new file mode 100755 index 0000000..88e08c1 --- /dev/null +++ b/examples/example_004.php @@ -0,0 +1,121 @@ +SetCreator(PDF_CREATOR); +$pdf->SetAuthor('Nicola Asuni'); +$pdf->SetTitle('TCPDF Example 004'); +$pdf->SetSubject('TCPDF Tutorial'); +$pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + +// set default header data +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 004', PDF_HEADER_STRING); + +// set header and footer fonts +$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); +$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font +$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +// set margins +$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); +$pdf->SetHeaderMargin(PDF_MARGIN_HEADER); +$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + +// set auto page breaks +$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +// set image scale factor +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +// set some language-dependent strings (optional) +if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { + require_once(dirname(__FILE__).'/lang/eng.php'); + $pdf->setLanguageArray($l); +} + +// --------------------------------------------------------- + +// set font +$pdf->SetFont('times', '', 11); + +// add a page +$pdf->AddPage(); + +//Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=0, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') + +// test Cell stretching +$pdf->Cell(0, 0, 'TEST CELL STRETCH: no stretch', 1, 1, 'C', 0, '', 0); +$pdf->Cell(0, 0, 'TEST CELL STRETCH: scaling', 1, 1, 'C', 0, '', 1); +$pdf->Cell(0, 0, 'TEST CELL STRETCH: force scaling', 1, 1, 'C', 0, '', 2); +$pdf->Cell(0, 0, 'TEST CELL STRETCH: spacing', 1, 1, 'C', 0, '', 3); +$pdf->Cell(0, 0, 'TEST CELL STRETCH: force spacing', 1, 1, 'C', 0, '', 4); + +$pdf->Ln(5); + +$pdf->Cell(45, 0, 'TEST CELL STRETCH: scaling', 1, 1, 'C', 0, '', 1); +$pdf->Cell(45, 0, 'TEST CELL STRETCH: force scaling', 1, 1, 'C', 0, '', 2); +$pdf->Cell(45, 0, 'TEST CELL STRETCH: spacing', 1, 1, 'C', 0, '', 3); +$pdf->Cell(45, 0, 'TEST CELL STRETCH: force spacing', 1, 1, 'C', 0, '', 4); + +$pdf->AddPage(); + +// example using general stretching and spacing + +for ($stretching = 90; $stretching <= 110; $stretching += 10) { + for ($spacing = -0.254; $spacing <= 0.254; $spacing += 0.254) { + + // set general stretching (scaling) value + $pdf->setFontStretching($stretching); + + // set general spacing value + $pdf->setFontSpacing($spacing); + + $pdf->Cell(0, 0, 'Stretching '.$stretching.'%, Spacing '.sprintf('%+.3F', $spacing).'mm, no stretch', 1, 1, 'C', 0, '', 0); + $pdf->Cell(0, 0, 'Stretching '.$stretching.'%, Spacing '.sprintf('%+.3F', $spacing).'mm, scaling', 1, 1, 'C', 0, '', 1); + $pdf->Cell(0, 0, 'Stretching '.$stretching.'%, Spacing '.sprintf('%+.3F', $spacing).'mm, force scaling', 1, 1, 'C', 0, '', 2); + $pdf->Cell(0, 0, 'Stretching '.$stretching.'%, Spacing '.sprintf('%+.3F', $spacing).'mm, spacing', 1, 1, 'C', 0, '', 3); + $pdf->Cell(0, 0, 'Stretching '.$stretching.'%, Spacing '.sprintf('%+.3F', $spacing).'mm, force spacing', 1, 1, 'C', 0, '', 4); + + $pdf->Ln(2); + } +} + +// --------------------------------------------------------- + +//Close and output PDF document +$pdf->Output('example_004.pdf', 'I'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/example_005.php b/examples/example_005.php new file mode 100755 index 0000000..5a592d1 --- /dev/null +++ b/examples/example_005.php @@ -0,0 +1,158 @@ +SetCreator(PDF_CREATOR); +$pdf->SetAuthor('Nicola Asuni'); +$pdf->SetTitle('TCPDF Example 005'); +$pdf->SetSubject('TCPDF Tutorial'); +$pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + +// set default header data +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 005', PDF_HEADER_STRING); + +// set header and footer fonts +$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); +$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font +$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +// set margins +$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); +$pdf->SetHeaderMargin(PDF_MARGIN_HEADER); +$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + +// set auto page breaks +$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +// set image scale factor +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +// set some language-dependent strings (optional) +if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { + require_once(dirname(__FILE__).'/lang/eng.php'); + $pdf->setLanguageArray($l); +} + +// --------------------------------------------------------- + +// set font +$pdf->SetFont('times', '', 10); + +// add a page +$pdf->AddPage(); + +// set cell padding +$pdf->setCellPaddings(1, 1, 1, 1); + +// set cell margins +$pdf->setCellMargins(1, 1, 1, 1); + +// set color for background +$pdf->SetFillColor(255, 255, 127); + +// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0) + +// set some text for example +$txt = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'; + +// Multicell test +$pdf->MultiCell(55, 5, '[LEFT] '.$txt, 1, 'L', 1, 0, '', '', true); +$pdf->MultiCell(55, 5, '[RIGHT] '.$txt, 1, 'R', 0, 1, '', '', true); +$pdf->MultiCell(55, 5, '[CENTER] '.$txt, 1, 'C', 0, 0, '', '', true); +$pdf->MultiCell(55, 5, '[JUSTIFY] '.$txt."\n", 1, 'J', 1, 2, '' ,'', true); +$pdf->MultiCell(55, 5, '[DEFAULT] '.$txt, 1, '', 0, 1, '', '', true); + +$pdf->Ln(4); + +// set color for background +$pdf->SetFillColor(220, 255, 220); + +// Vertical alignment +$pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - TOP] '.$txt, 1, 'J', 1, 0, '', '', true, 0, false, true, 40, 'T'); +$pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - MIDDLE] '.$txt, 1, 'J', 1, 0, '', '', true, 0, false, true, 40, 'M'); +$pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - BOTTOM] '.$txt, 1, 'J', 1, 1, '', '', true, 0, false, true, 40, 'B'); + +$pdf->Ln(4); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// set color for background +$pdf->SetFillColor(215, 235, 255); + +// set some text for example +$txt = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc. + +Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.'; + +// print a blox of text using multicell() +$pdf->MultiCell(80, 5, $txt."\n", 1, 'J', 1, 1, '' ,'', true); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// AUTO-FITTING + +// set color for background +$pdf->SetFillColor(255, 235, 235); + +// Fit text on cell by reducing font size +$pdf->MultiCell(55, 60, '[FIT CELL] '.$txt."\n", 1, 'J', 1, 1, 125, 145, true, 0, false, true, 60, 'M', true); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// CUSTOM PADDING + +// set color for background +$pdf->SetFillColor(255, 255, 215); + +// set font +$pdf->SetFont('helvetica', '', 8); + +// set cell padding +$pdf->setCellPaddings(2, 4, 6, 8); + +$txt = "CUSTOM PADDING:\nLeft=2, Top=4, Right=6, Bottom=8\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue.\n"; + +$pdf->MultiCell(55, 5, $txt, 1, 'J', 1, 2, 125, 210, true); + +// move pointer to last page +$pdf->lastPage(); + +// --------------------------------------------------------- + +//Close and output PDF document +$pdf->Output('example_005.pdf', 'I'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/example_006.php b/examples/example_006.php new file mode 100755 index 0000000..481f70e --- /dev/null +++ b/examples/example_006.php @@ -0,0 +1,330 @@ +SetCreator(PDF_CREATOR); +$pdf->SetAuthor('Nicola Asuni'); +$pdf->SetTitle('TCPDF Example 006'); +$pdf->SetSubject('TCPDF Tutorial'); +$pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + +// set default header data +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING); + +// set header and footer fonts +$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); +$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font +$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +// set margins +$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); +$pdf->SetHeaderMargin(PDF_MARGIN_HEADER); +$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + +// set auto page breaks +$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +// set image scale factor +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +// set some language-dependent strings (optional) +if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { + require_once(dirname(__FILE__).'/lang/eng.php'); + $pdf->setLanguageArray($l); +} + +// --------------------------------------------------------- + +// set font +$pdf->SetFont('dejavusans', '', 10); + +// add a page +$pdf->AddPage(); + +// writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='') +// writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0, $reseth=true, $align='', $autopadding=true) + +// create some HTML content +$html = '

HTML Example

+Some special characters: < € € € & è è © > \\slash \\\\double-slash \\\\\\triple-slash +

List

+List example: +
    +
  1. test alt attribute test image
  2. +
  3. bold text
  4. +
  5. italic text
  6. +
  7. underlined text
  8. +
  9. bbibiubib
  10. +
  11. link to http://www.tecnick.com
  12. +
  13. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
    Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
  14. +
  15. SUBLIST +
      +
    1. row one +
        +
      • sublist
      • +
      +
    2. +
    3. row two
    4. +
    +
  16. +
  17. TEST line through
  18. +
  19. font + 3
  20. +
  21. small text normal small text normal subscript normal superscript normal
  22. +
+
+
Coffee
+
Black hot drink
+
Milk
+
White cold drink
+
+
IMAGES
+test alt attributetest alt attributetest alt attribute +
'; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + + +// output some RTL HTML content +$html = '
The words “מזל [mazel] טוב [tov]” mean “Congratulations!”
'; +$pdf->writeHTML($html, true, false, true, false, ''); + +// test some inline CSS +$html = '

This is just an example of html code to demonstrate some supported CSS inline styles. +bold text +line-trough +underline and line-trough +color +background color +bold +xx-small +x-small +small +medium +large +x-large +xx-large +

'; + +$pdf->writeHTML($html, true, false, true, false, ''); + +// reset pointer to the last page +$pdf->lastPage(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Print a table + +// add a page +$pdf->AddPage(); + +// create some HTML content +$subtable = '
ab
cd
'; + +$html = '

HTML TABLE:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#RIGHT alignLEFT align4A
1A1 example link column span. One two tree four five six seven eight nine ten.
line after br
small text normal subscript normal superscript normal bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  1. first
    1. sublist
    2. sublist
  2. second
small small small small small small small small small small small small small small small small small small small small
4B
'.$subtable.'A2 € € € & è è
A2 € € € & è è
Red Yellow BG4C
1A2AA
2AB
2AC
4D
1B4E
1C2C3C4F
'; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +// Print some HTML Cells + +$html = 'red green blue
red green blue'; + +$pdf->SetFillColor(255,255,0); + +$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 0, true, 'L', true); +$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 1, true, 'C', true); +$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 0, true, 'R', true); + +// reset pointer to the last page +$pdf->lastPage(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Print a table + +// add a page +$pdf->AddPage(); + +// create some HTML content +$html = '

Image alignments on HTML table

+ + + + + + + + +
'; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +// reset pointer to the last page +$pdf->lastPage(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Print all HTML colors + +// add a page +$pdf->AddPage(); + +$textcolors = '

HTML Text Colors

'; +$bgcolors = '

HTML Background Colors

'; + +foreach(TCPDF_COLORS::$webcolor as $k => $v) { + $textcolors .= ''.$v.' '; + $bgcolors .= ''.$v.' '; +} + +// output the HTML content +$pdf->writeHTML($textcolors, true, false, true, false, ''); +$pdf->writeHTML($bgcolors, true, false, true, false, ''); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// Test word-wrap + +// create some HTML content +$html = '
+

Various tests

+link to page 2
+thisisaverylongword thisisanotherverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword'; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +// Test fonts nesting +$html1 = 'Default Courier Helvetica Times dejavusans Times Helvetica Courier Default'; +$html2 = 'small text normal small text normal subscript normal superscript normal'; +$html3 = 'The quick brown fox jumps over the lazy dog.'; + +$html = $html1.'
'.$html2.'
'.$html3.'
'.$html3.'
'.$html2; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// test pre tag + +// add a page +$pdf->AddPage(); + +$html = << +Hello World!
+Hello + +
+int main() {
+    printf("HelloWorld");
+    return 0;
+}
+
+Monospace font, normal font, monospace font, normal font. +
+
DIV LEVEL 1
DIV LEVEL 2
DIV LEVEL 1
+
+SPAN LEVEL 1 SPAN LEVEL 2 SPAN LEVEL 1 +EOF; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// test custom bullet points for list + +// add a page +$pdf->AddPage(); + +$html = <<Test custom bullet image for list items +