mirror of
https://github.com/Karaka-Management/Resources.git
synced 2026-01-11 05:18:40 +00:00
autofixes
This commit is contained in:
parent
374228321f
commit
cdd0f7157b
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : tcpdf_config.php
|
||||
// Begin : 2004-06-11
|
||||
|
|
@ -40,7 +40,6 @@
|
|||
// If you define the constant K_TCPDF_EXTERNAL_CONFIG, all the following settings will be ignored.
|
||||
// If you use the tcpdf_autoconfig.php, then you can overwrite some values here.
|
||||
|
||||
|
||||
/**
|
||||
* Installation path (/var/www/tcpdf/).
|
||||
* By default it is automatically calculated but you can also set it as a fixed string to improve performances.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_1d_html.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 1D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_1d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_1d_png.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,13 +40,13 @@
|
|||
*/
|
||||
|
||||
// include 1D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php');
|
||||
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));
|
||||
$barcodeobj->getBarcodePNG(2, 30, [0,0,0]);
|
||||
|
||||
//============================================================+
|
||||
// END OF FILE
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_1d_svg.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 1D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_1d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_1d_svgi.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 1D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_1d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_html.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'DATAMATRIX');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_png.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,13 +40,13 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
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));
|
||||
$barcodeobj->getBarcodePNG(6, 6, [0,0,0]);
|
||||
|
||||
//============================================================+
|
||||
// END OF FILE
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_svg.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'DATAMATRIX');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_svgi.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'DATAMATRIX');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_html.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_png.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,13 +40,13 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
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));
|
||||
$barcodeobj->getBarcodePNG(4, 4, [0,0,0]);
|
||||
|
||||
//============================================================+
|
||||
// END OF FILE
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_svg.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_svgi.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_html.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_png.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,13 +40,13 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
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));
|
||||
$barcodeobj->getBarcodePNG(6, 6, [0,0,0]);
|
||||
|
||||
//============================================================+
|
||||
// END OF FILE
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_svg.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_2d_svgi.php
|
||||
// Version : 1.0.000
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
// include 2D barcode class (search for installation path)
|
||||
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
require_once(\dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||
|
||||
// set the barcode content and type
|
||||
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : tcpdf_barcodes_1d_include.php
|
||||
// Begin : 2013-05-19
|
||||
|
|
@ -24,18 +24,18 @@
|
|||
*/
|
||||
|
||||
// Include the TCPDF 1D barcode class (search the class on the following directories).
|
||||
$tcpdf_barcodes_1d_include_dirs = array(
|
||||
realpath(dirname(__FILE__) . '/../../tcpdf_barcodes_1d.php'),// True source file
|
||||
realpath('../../tcpdf_barcodes_1d.php'),// Relative from $PWD
|
||||
$tcpdf_barcodes_1d_include_dirs = [
|
||||
\realpath(\dirname(__FILE__) . '/../../tcpdf_barcodes_1d.php'),// True source file
|
||||
\realpath('../../tcpdf_barcodes_1d.php'),// Relative from $PWD
|
||||
'/usr/share/php/tcpdf/tcpdf_barcodes_1d.php',
|
||||
'/usr/share/tcpdf/tcpdf_barcodes_1d.php',
|
||||
'/usr/share/php-tcpdf/tcpdf_barcodes_1d.php',
|
||||
'/var/www/tcpdf/tcpdf_barcodes_1d.php',
|
||||
'/var/www/html/tcpdf/tcpdf_barcodes_1d.php',
|
||||
'/usr/local/apache2/htdocs/tcpdf/tcpdf_barcodes_1d.php'
|
||||
);
|
||||
'/usr/local/apache2/htdocs/tcpdf/tcpdf_barcodes_1d.php',
|
||||
];
|
||||
foreach ($tcpdf_barcodes_1d_include_dirs as $tcpdf_barcodes_1d_include_path) {
|
||||
if (@file_exists($tcpdf_barcodes_1d_include_path)) {
|
||||
if (@\file_exists($tcpdf_barcodes_1d_include_path)) {
|
||||
require_once($tcpdf_barcodes_1d_include_path);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : tcpdf_barcodes_2d_include.php
|
||||
// Begin : 2013-05-19
|
||||
|
|
@ -24,18 +24,18 @@
|
|||
*/
|
||||
|
||||
// Include the TCPDF 2D barcode class (search the class on the following directories).
|
||||
$tcpdf_barcodes_2d_include_dirs = array(
|
||||
realpath(dirname(__FILE__) . '/../../tcpdf_barcodes_2d.php'),// True source file
|
||||
realpath('../../tcpdf_barcodes_2d.php'),// Relative from $PWD
|
||||
$tcpdf_barcodes_2d_include_dirs = [
|
||||
\realpath(\dirname(__FILE__) . '/../../tcpdf_barcodes_2d.php'),// True source file
|
||||
\realpath('../../tcpdf_barcodes_2d.php'),// Relative from $PWD
|
||||
'/usr/share/php/tcpdf/tcpdf_barcodes_2d.php',
|
||||
'/usr/share/tcpdf/tcpdf_barcodes_2d.php',
|
||||
'/usr/share/php-tcpdf/tcpdf_barcodes_2d.php',
|
||||
'/var/www/tcpdf/tcpdf_barcodes_2d.php',
|
||||
'/var/www/html/tcpdf/tcpdf_barcodes_2d.php',
|
||||
'/usr/local/apache2/htdocs/tcpdf/tcpdf_barcodes_2d.php'
|
||||
);
|
||||
'/usr/local/apache2/htdocs/tcpdf/tcpdf_barcodes_2d.php',
|
||||
];
|
||||
foreach ($tcpdf_barcodes_2d_include_dirs as $tcpdf_barcodes_2d_include_path) {
|
||||
if (@file_exists($tcpdf_barcodes_2d_include_path)) {
|
||||
if (@\file_exists($tcpdf_barcodes_2d_include_path)) {
|
||||
require_once($tcpdf_barcodes_2d_include_path);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : tcpdf_config.php
|
||||
// Begin : 2004-06-11
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
/**
|
||||
* Define the following constant to ignore the default configuration file.
|
||||
*/
|
||||
define ('K_TCPDF_EXTERNAL_CONFIG', true);
|
||||
\define('K_TCPDF_EXTERNAL_CONFIG', true);
|
||||
|
||||
/**
|
||||
* Installation path (/var/www/tcpdf/).
|
||||
|
|
@ -63,159 +63,159 @@ define ('K_TCPDF_EXTERNAL_CONFIG', true);
|
|||
* 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/');
|
||||
\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');
|
||||
\define('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
|
||||
|
||||
/**
|
||||
* Header logo image width in user units.
|
||||
*/
|
||||
define ('PDF_HEADER_LOGO_WIDTH', 30);
|
||||
\define('PDF_HEADER_LOGO_WIDTH', 30);
|
||||
|
||||
/**
|
||||
* Cache directory for temporary files (full path).
|
||||
*/
|
||||
define ('K_PATH_CACHE', sys_get_temp_dir().'/');
|
||||
\define('K_PATH_CACHE', \sys_get_temp_dir().'/');
|
||||
|
||||
/**
|
||||
* Generic name for a blank image.
|
||||
*/
|
||||
define ('K_BLANK_IMAGE', '_blank.png');
|
||||
\define('K_BLANK_IMAGE', '_blank.png');
|
||||
|
||||
/**
|
||||
* Page format.
|
||||
*/
|
||||
define ('PDF_PAGE_FORMAT', 'A4');
|
||||
\define('PDF_PAGE_FORMAT', 'A4');
|
||||
|
||||
/**
|
||||
* Page orientation (P=portrait, L=landscape).
|
||||
*/
|
||||
define ('PDF_PAGE_ORIENTATION', 'P');
|
||||
\define('PDF_PAGE_ORIENTATION', 'P');
|
||||
|
||||
/**
|
||||
* Document creator.
|
||||
*/
|
||||
define ('PDF_CREATOR', 'TCPDF');
|
||||
\define('PDF_CREATOR', 'TCPDF');
|
||||
|
||||
/**
|
||||
* Document author.
|
||||
*/
|
||||
define ('PDF_AUTHOR', 'TCPDF');
|
||||
\define('PDF_AUTHOR', 'TCPDF');
|
||||
|
||||
/**
|
||||
* Header title.
|
||||
*/
|
||||
define ('PDF_HEADER_TITLE', 'TCPDF Example');
|
||||
\define('PDF_HEADER_TITLE', 'TCPDF Example');
|
||||
|
||||
/**
|
||||
* Header description string.
|
||||
*/
|
||||
define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
|
||||
\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');
|
||||
\define('PDF_UNIT', 'mm');
|
||||
|
||||
/**
|
||||
* Header margin.
|
||||
*/
|
||||
define ('PDF_MARGIN_HEADER', 5);
|
||||
\define('PDF_MARGIN_HEADER', 5);
|
||||
|
||||
/**
|
||||
* Footer margin.
|
||||
*/
|
||||
define ('PDF_MARGIN_FOOTER', 10);
|
||||
\define('PDF_MARGIN_FOOTER', 10);
|
||||
|
||||
/**
|
||||
* Top margin.
|
||||
*/
|
||||
define ('PDF_MARGIN_TOP', 27);
|
||||
\define('PDF_MARGIN_TOP', 27);
|
||||
|
||||
/**
|
||||
* Bottom margin.
|
||||
*/
|
||||
define ('PDF_MARGIN_BOTTOM', 25);
|
||||
\define('PDF_MARGIN_BOTTOM', 25);
|
||||
|
||||
/**
|
||||
* Left margin.
|
||||
*/
|
||||
define ('PDF_MARGIN_LEFT', 15);
|
||||
\define('PDF_MARGIN_LEFT', 15);
|
||||
|
||||
/**
|
||||
* Right margin.
|
||||
*/
|
||||
define ('PDF_MARGIN_RIGHT', 15);
|
||||
\define('PDF_MARGIN_RIGHT', 15);
|
||||
|
||||
/**
|
||||
* Default main font name.
|
||||
*/
|
||||
define ('PDF_FONT_NAME_MAIN', 'helvetica');
|
||||
\define('PDF_FONT_NAME_MAIN', 'helvetica');
|
||||
|
||||
/**
|
||||
* Default main font size.
|
||||
*/
|
||||
define ('PDF_FONT_SIZE_MAIN', 10);
|
||||
\define('PDF_FONT_SIZE_MAIN', 10);
|
||||
|
||||
/**
|
||||
* Default data font name.
|
||||
*/
|
||||
define ('PDF_FONT_NAME_DATA', 'helvetica');
|
||||
\define('PDF_FONT_NAME_DATA', 'helvetica');
|
||||
|
||||
/**
|
||||
* Default data font size.
|
||||
*/
|
||||
define ('PDF_FONT_SIZE_DATA', 8);
|
||||
\define('PDF_FONT_SIZE_DATA', 8);
|
||||
|
||||
/**
|
||||
* Default monospaced font name.
|
||||
*/
|
||||
define ('PDF_FONT_MONOSPACED', 'courier');
|
||||
\define('PDF_FONT_MONOSPACED', 'courier');
|
||||
|
||||
/**
|
||||
* Ratio used to adjust the conversion of pixels to user units.
|
||||
*/
|
||||
define ('PDF_IMAGE_SCALE_RATIO', 1.25);
|
||||
\define('PDF_IMAGE_SCALE_RATIO', 1.25);
|
||||
|
||||
/**
|
||||
* Magnification factor for titles.
|
||||
*/
|
||||
define('HEAD_MAGNIFICATION', 1.1);
|
||||
\define('HEAD_MAGNIFICATION', 1.1);
|
||||
|
||||
/**
|
||||
* Height of cell respect font height.
|
||||
*/
|
||||
define('K_CELL_HEIGHT_RATIO', 1.25);
|
||||
\define('K_CELL_HEIGHT_RATIO', 1.25);
|
||||
|
||||
/**
|
||||
* Title magnification respect main font size.
|
||||
*/
|
||||
define('K_TITLE_MAGNIFICATION', 1.3);
|
||||
\define('K_TITLE_MAGNIFICATION', 1.3);
|
||||
|
||||
/**
|
||||
* Reduction factor for small font.
|
||||
*/
|
||||
define('K_SMALL_RATIO', 2/3);
|
||||
\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);
|
||||
\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);
|
||||
\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);
|
||||
\define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
|
||||
|
||||
//============================================================+
|
||||
// END OF FILE
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_001.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -38,12 +38,12 @@ $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));
|
||||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, [0,64,255], [0,64,128]);
|
||||
$pdf->setFooterData([0,64,0], [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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -54,14 +54,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ $pdf->setFont('dejavusans', '', 14, '', true);
|
|||
$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'));
|
||||
$pdf->setTextShadow(['enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>[196,196,196], 'opacity'=>1, 'blend_mode'=>'Normal']);
|
||||
|
||||
// Set some content to print
|
||||
$html = <<<EOD
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_002.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -48,14 +48,14 @@ $pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
|||
$pdf->setMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_003.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -27,12 +27,10 @@
|
|||
// Include the main TCPDF library (search for installation path).
|
||||
require_once('tcpdf_include.php');
|
||||
|
||||
|
||||
// Extend the TCPDF class to create custom Header and Footer
|
||||
class MYPDF extends TCPDF {
|
||||
|
||||
//Page header
|
||||
public function Header() {
|
||||
public function Header() : void {
|
||||
// Logo
|
||||
$image_file = K_PATH_IMAGES.'logo_example.jpg';
|
||||
$this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
|
||||
|
|
@ -43,7 +41,7 @@ class MYPDF extends TCPDF {
|
|||
}
|
||||
|
||||
// Page footer
|
||||
public function Footer() {
|
||||
public function Footer() : void {
|
||||
// Position at 15 mm from bottom
|
||||
$this->setY(-15);
|
||||
// Set font
|
||||
|
|
@ -67,8 +65,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -79,14 +77,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_004.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -94,18 +94,17 @@ $pdf->AddPage();
|
|||
|
||||
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->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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_005.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_006.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +115,6 @@ List example:
|
|||
// output the HTML content
|
||||
$pdf->writeHTML($html, true, false, true, false, '');
|
||||
|
||||
|
||||
// output some RTL HTML content
|
||||
$html = '<div style="text-align:center">The words “<span dir="rtl">מזל [mazel] טוב [tov]</span>” mean “Congratulations!”</div>';
|
||||
$pdf->writeHTML($html, true, false, true, false, '');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_007.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 007', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_008.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 008', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ $pdf->setFont('freeserif', '', 12);
|
|||
$pdf->AddPage();
|
||||
|
||||
// get esternal file content
|
||||
$utf8text = file_get_contents('data/utf8test.txt', false);
|
||||
$utf8text = \file_get_contents('data/utf8test.txt', false);
|
||||
|
||||
// set color for text
|
||||
$pdf->setTextColor(0, 63, 127);
|
||||
|
|
@ -86,7 +86,6 @@ $pdf->setTextColor(0, 63, 127);
|
|||
// write the text
|
||||
$pdf->Write(5, $utf8text, '', 0, '', false, 0, false, false, 0);
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
//Close and output PDF document
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_009.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 009', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ $pdf->setJPEGQuality(75);
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
// Example of Image from data stream ('PHP rules')
|
||||
$imgdata = base64_decode('iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABlBMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDrEX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg==');
|
||||
$imgdata = \base64_decode('iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABlBMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDrEX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg==');
|
||||
|
||||
// The '@' character is used to indicate that follows an image data stream and not an image file name
|
||||
$pdf->Image('@'.$imgdata);
|
||||
|
|
@ -92,8 +92,8 @@ $pdf->Image('images/image_demo.jpg', 15, 140, 75, 113, 'JPG', 'http://www.tcpdf.
|
|||
|
||||
// test fitbox with all alignment combinations
|
||||
|
||||
$horizontal_alignments = array('L', 'C', 'R');
|
||||
$vertical_alignments = array('T', 'M', 'B');
|
||||
$horizontal_alignments = ['L', 'C', 'R'];
|
||||
$vertical_alignments = ['T', 'M', 'B'];
|
||||
|
||||
$x = 15;
|
||||
$y = 35;
|
||||
|
|
@ -105,7 +105,7 @@ for ($i = 0; $i < 3; ++$i) {
|
|||
$x = 15;
|
||||
for ($j = 0; $j < 3; ++$j) {
|
||||
$fitbox[1] = $vertical_alignments[$j];
|
||||
$pdf->Rect($x, $y, $w, $h, 'F', array(), array(128,255,128));
|
||||
$pdf->Rect($x, $y, $w, $h, 'F', [], [128,255,128]);
|
||||
$pdf->Image('images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '', '', false, 300, '', false, false, 0, $fitbox, false, false);
|
||||
$x += 32; // new column
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ for ($i = 0; $i < 3; ++$i) {
|
|||
$x = 115;
|
||||
for ($j = 0; $j < 3; ++$j) {
|
||||
$fitbox[1] = $vertical_alignments[$j];
|
||||
$pdf->Rect($x, $y, $w, $h, 'F', array(), array(128,255,255));
|
||||
$pdf->Rect($x, $y, $w, $h, 'F', [], [128,255,255]);
|
||||
$pdf->Image('images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '', '', false, 300, '', false, false, 0, $fitbox, false, false);
|
||||
$x += 27; // new column
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_010.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -27,21 +27,19 @@
|
|||
// Include the main TCPDF library (search for installation path).
|
||||
require_once('tcpdf_include.php');
|
||||
|
||||
|
||||
/**
|
||||
* Extend TCPDF to work with multiple columns
|
||||
*/
|
||||
class MC_TCPDF extends TCPDF {
|
||||
|
||||
/**
|
||||
* Print chapter
|
||||
* @param int $num chapter number
|
||||
* @param string $title chapter title
|
||||
* @param string $file name of the file containing the chapter body
|
||||
* @param boolean $mode if true the chapter body is in HTML, otherwise in simple text.
|
||||
* @param bool $mode if true the chapter body is in HTML, otherwise in simple text
|
||||
* @public
|
||||
*/
|
||||
public function PrintChapter($num, $title, $file, $mode=false) {
|
||||
public function PrintChapter($num, $title, $file, $mode=false) : void {
|
||||
// add a new page
|
||||
$this->AddPage();
|
||||
// disable existing columns
|
||||
|
|
@ -60,7 +58,7 @@ class MC_TCPDF extends TCPDF {
|
|||
* @param string $title chapter title
|
||||
* @public
|
||||
*/
|
||||
public function ChapterTitle($num, $title) {
|
||||
public function ChapterTitle($num, $title) : void {
|
||||
$this->setFont('helvetica', '', 14);
|
||||
$this->setFillColor(200, 220, 255);
|
||||
$this->Cell(180, 6, 'Chapter '.$num.' : '.$title, 0, 1, '', 1);
|
||||
|
|
@ -70,13 +68,13 @@ class MC_TCPDF extends TCPDF {
|
|||
/**
|
||||
* Print chapter body
|
||||
* @param string $file name of the file containing the chapter body
|
||||
* @param boolean $mode if true the chapter body is in HTML, otherwise in simple text.
|
||||
* @param bool $mode if true the chapter body is in HTML, otherwise in simple text
|
||||
* @public
|
||||
*/
|
||||
public function ChapterBody($file, $mode=false) {
|
||||
public function ChapterBody($file, $mode=false) : void {
|
||||
$this->selectColumn();
|
||||
// get esternal file content
|
||||
$content = file_get_contents($file, false);
|
||||
$content = \file_get_contents($file, false);
|
||||
// set font
|
||||
$this->setFont('times', '', 9);
|
||||
$this->setTextColor(50, 50, 50);
|
||||
|
|
@ -109,8 +107,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 010', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -121,14 +119,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_011.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -29,20 +29,19 @@ require_once('tcpdf_include.php');
|
|||
|
||||
// extend TCPF with custom functions
|
||||
class MYPDF extends TCPDF {
|
||||
|
||||
// Load table data from file
|
||||
public function LoadData($file) {
|
||||
// Read file lines
|
||||
$lines = file($file);
|
||||
$data = array();
|
||||
$lines = \file($file);
|
||||
$data = [];
|
||||
foreach($lines as $line) {
|
||||
$data[] = explode(';', chop($line));
|
||||
$data[] = \explode(';', \rtrim($line));
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
// Colored table
|
||||
public function ColoredTable($header,$data) {
|
||||
public function ColoredTable($header,$data) : void {
|
||||
// Colors, line width and bold font
|
||||
$this->setFillColor(255, 0, 0);
|
||||
$this->setTextColor(255);
|
||||
|
|
@ -50,8 +49,8 @@ class MYPDF extends TCPDF {
|
|||
$this->setLineWidth(0.3);
|
||||
$this->setFont('', 'B');
|
||||
// Header
|
||||
$w = array(40, 35, 40, 45);
|
||||
$num_headers = count($header);
|
||||
$w = [40, 35, 40, 45];
|
||||
$num_headers = \count($header);
|
||||
for($i = 0; $i < $num_headers; ++$i) {
|
||||
$this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', 1);
|
||||
}
|
||||
|
|
@ -65,12 +64,12 @@ class MYPDF extends TCPDF {
|
|||
foreach($data as $row) {
|
||||
$this->Cell($w[0], 6, $row[0], 'LR', 0, 'L', $fill);
|
||||
$this->Cell($w[1], 6, $row[1], 'LR', 0, 'L', $fill);
|
||||
$this->Cell($w[2], 6, number_format($row[2]), 'LR', 0, 'R', $fill);
|
||||
$this->Cell($w[3], 6, number_format($row[3]), 'LR', 0, 'R', $fill);
|
||||
$this->Cell($w[2], 6, \number_format($row[2]), 'LR', 0, 'R', $fill);
|
||||
$this->Cell($w[3], 6, \number_format($row[3]), 'LR', 0, 'R', $fill);
|
||||
$this->Ln();
|
||||
$fill=!$fill;
|
||||
}
|
||||
$this->Cell(array_sum($w), 0, '', 'T');
|
||||
$this->Cell(\array_sum($w), 0, '', 'T');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -88,8 +87,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 011', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -100,14 +99,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -120,7 +119,7 @@ $pdf->setFont('helvetica', '', 12);
|
|||
$pdf->AddPage();
|
||||
|
||||
// column titles
|
||||
$header = array('Country', 'Capital', 'Area (sq km)', 'Pop. (thousands)');
|
||||
$header = ['Country', 'Capital', 'Area (sq km)', 'Pop. (thousands)'];
|
||||
|
||||
// data loading
|
||||
$data = $pdf->LoadData('data/table_data_demo.txt');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_012.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -48,14 +48,14 @@ $pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
|||
$pdf->setMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -67,16 +67,16 @@ $pdf->setFont('helvetica', '', 10);
|
|||
// add a page
|
||||
$pdf->AddPage();
|
||||
|
||||
$style = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,20,5,10', 'phase' => 10, 'color' => array(255, 0, 0));
|
||||
$style2 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0));
|
||||
$style3 = array('width' => 1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(255, 0, 0));
|
||||
$style4 = array('L' => 0,
|
||||
'T' => array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => array(100, 100, 255)),
|
||||
'R' => array('width' => 0.50, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => array(50, 50, 127)),
|
||||
'B' => array('width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10'));
|
||||
$style5 = array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 64, 128));
|
||||
$style6 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,10', 'color' => array(0, 128, 0));
|
||||
$style7 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 128, 0));
|
||||
$style = ['width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,20,5,10', 'phase' => 10, 'color' => [255, 0, 0]];
|
||||
$style2 = ['width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [255, 0, 0]];
|
||||
$style3 = ['width' => 1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => [255, 0, 0]];
|
||||
$style4 = ['L' => 0,
|
||||
'T' => ['width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => [100, 100, 255]],
|
||||
'R' => ['width' => 0.50, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => [50, 50, 127]],
|
||||
'B' => ['width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10']];
|
||||
$style5 = ['width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [0, 64, 128]];
|
||||
$style6 = ['width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,10', 'color' => [0, 128, 0]];
|
||||
$style7 = ['width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [255, 128, 0]];
|
||||
|
||||
// Line
|
||||
$pdf->Text(5, 4, 'Line examples');
|
||||
|
|
@ -86,14 +86,14 @@ $pdf->Line(5, 10, 80, 10, $style3);
|
|||
|
||||
// Rect
|
||||
$pdf->Text(100, 4, 'Rectangle examples');
|
||||
$pdf->Rect(100, 10, 40, 20, 'DF', $style4, array(220, 220, 200));
|
||||
$pdf->Rect(145, 10, 40, 20, 'D', array('all' => $style3));
|
||||
$pdf->Rect(100, 10, 40, 20, 'DF', $style4, [220, 220, 200]);
|
||||
$pdf->Rect(145, 10, 40, 20, 'D', ['all' => $style3]);
|
||||
|
||||
// Curve
|
||||
$pdf->Text(5, 34, 'Curve examples');
|
||||
$pdf->Curve(5, 40, 30, 55, 70, 45, 60, 75, '', $style6);
|
||||
$pdf->Curve(80, 40, 70, 75, 150, 45, 100, 75, 'F', $style6);
|
||||
$pdf->Curve(140, 40, 150, 55, 180, 45, 200, 75, 'DF', $style6, array(200, 220, 200));
|
||||
$pdf->Curve(140, 40, 150, 55, 180, 45, 200, 75, 'DF', $style6, [200, 220, 200]);
|
||||
|
||||
// Circle and ellipse
|
||||
$pdf->Text(5, 79, 'Circle and ellipse examples');
|
||||
|
|
@ -111,28 +111,28 @@ $pdf->Ellipse(100,105,20,10, 0, 270, 360, 'DF', $style6);
|
|||
$pdf->setLineStyle($style5);
|
||||
$pdf->Ellipse(175,103,30,15,45);
|
||||
$pdf->Ellipse(175,105,15,7.50, 45, 90, 180, '', $style6);
|
||||
$pdf->Ellipse(175,105,15,7.50, 45, 270, 360, 'F', $style6, array(220, 200, 200));
|
||||
$pdf->Ellipse(175,105,15,7.50, 45, 270, 360, 'F', $style6, [220, 200, 200]);
|
||||
|
||||
// Polygon
|
||||
$pdf->Text(5, 129, 'Polygon examples');
|
||||
$pdf->setLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
|
||||
$pdf->Polygon(array(5,135,45,135,15,165));
|
||||
$pdf->Polygon(array(60,135,80,135,80,155,70,165,50,155), 'DF', array($style6, $style7, $style7, 0, $style6), array(220, 200, 200));
|
||||
$pdf->Polygon(array(120,135,140,135,150,155,110,155), 'D', array($style6, 0, $style7, $style6));
|
||||
$pdf->Polygon(array(160,135,190,155,170,155,200,160,160,165), 'DF', array('all' => $style6), array(220, 220, 220));
|
||||
$pdf->setLineStyle(['width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [0, 0, 0]]);
|
||||
$pdf->Polygon([5,135,45,135,15,165]);
|
||||
$pdf->Polygon([60,135,80,135,80,155,70,165,50,155], 'DF', [$style6, $style7, $style7, 0, $style6], [220, 200, 200]);
|
||||
$pdf->Polygon([120,135,140,135,150,155,110,155], 'D', [$style6, 0, $style7, $style6]);
|
||||
$pdf->Polygon([160,135,190,155,170,155,200,160,160,165], 'DF', ['all' => $style6], [220, 220, 220]);
|
||||
|
||||
// Polygonal Line
|
||||
$pdf->setLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 164)));
|
||||
$pdf->PolyLine(array(80,165,90,160,100,165,110,160,120,165,130,160,140,165), 'D', array(), array());
|
||||
$pdf->setLineStyle(['width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [0, 0, 164]]);
|
||||
$pdf->PolyLine([80,165,90,160,100,165,110,160,120,165,130,160,140,165], 'D', [], []);
|
||||
|
||||
// Regular polygon
|
||||
$pdf->Text(5, 169, 'Regular polygon examples');
|
||||
$pdf->setLineStyle($style5);
|
||||
$pdf->RegularPolygon(20, 190, 15, 6, 0, 1, 'F');
|
||||
$pdf->RegularPolygon(55, 190, 15, 6);
|
||||
$pdf->RegularPolygon(55, 190, 10, 6, 45, false, 'DF', array($style6, 0, $style7, 0, $style7, $style7));
|
||||
$pdf->RegularPolygon(90, 190, 15, 3, 0, true, 'DF', array('all' => $style5), array(200, 220, 200), 'F', array(255, 200, 200));
|
||||
$pdf->RegularPolygon(125, 190, 15, 4, 30, true, '', array('all' => $style5), array(), '', $style6);
|
||||
$pdf->RegularPolygon(55, 190, 10, 6, 45, false, 'DF', [$style6, 0, $style7, 0, $style7, $style7]);
|
||||
$pdf->RegularPolygon(90, 190, 15, 3, 0, true, 'DF', ['all' => $style5], [200, 220, 200], 'F', [255, 200, 200]);
|
||||
$pdf->RegularPolygon(125, 190, 15, 4, 30, true, '', ['all' => $style5], [], '', $style6);
|
||||
$pdf->RegularPolygon(160, 190, 15, 10);
|
||||
|
||||
// Star polygon
|
||||
|
|
@ -140,19 +140,19 @@ $pdf->Text(5, 209, 'Star polygon examples');
|
|||
$pdf->setLineStyle($style5);
|
||||
$pdf->StarPolygon(20, 230, 15, 20, 3, 0, 1, 'F');
|
||||
$pdf->StarPolygon(55, 230, 15, 12, 5);
|
||||
$pdf->StarPolygon(55, 230, 7, 12, 5, 45, false, 'DF', array('all' => $style7), array(220, 220, 200), 'F', array(255, 200, 200));
|
||||
$pdf->StarPolygon(90, 230, 15, 20, 6, 0, true, 'DF', array('all' => $style5), array(220, 220, 200), 'F', array(255, 200, 200));
|
||||
$pdf->StarPolygon(125, 230, 15, 5, 2, 30, true, '', array('all' => $style5), array(), '', $style6);
|
||||
$pdf->StarPolygon(55, 230, 7, 12, 5, 45, false, 'DF', ['all' => $style7], [220, 220, 200], 'F', [255, 200, 200]);
|
||||
$pdf->StarPolygon(90, 230, 15, 20, 6, 0, true, 'DF', ['all' => $style5], [220, 220, 200], 'F', [255, 200, 200]);
|
||||
$pdf->StarPolygon(125, 230, 15, 5, 2, 30, true, '', ['all' => $style5], [], '', $style6);
|
||||
$pdf->StarPolygon(160, 230, 15, 10, 3);
|
||||
$pdf->StarPolygon(160, 230, 7, 50, 26);
|
||||
|
||||
// Rounded rectangle
|
||||
$pdf->Text(5, 249, 'Rounded rectangle examples');
|
||||
$pdf->setLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
|
||||
$pdf->setLineStyle(['width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [0, 0, 0]]);
|
||||
$pdf->RoundedRect(5, 255, 40, 30, 3.50, '1111', 'DF');
|
||||
$pdf->RoundedRect(50, 255, 40, 30, 6.50, '1000');
|
||||
$pdf->RoundedRect(95, 255, 40, 30, 10.0, '1111', '', $style6);
|
||||
$pdf->RoundedRect(140, 255, 40, 30, 8.0, '0101', 'DF', $style6, array(200, 200, 200));
|
||||
$pdf->RoundedRect(140, 255, 40, 30, 8.0, '0101', 'DF', $style6, [200, 200, 200]);
|
||||
|
||||
// Arrows
|
||||
$pdf->Text(185, 249, 'Arrows');
|
||||
|
|
@ -188,12 +188,11 @@ $pdf->Line($xc-50, $yc+50, $xc+50, $yc-50);
|
|||
|
||||
// ellipse
|
||||
$pdf->setDrawColor(200, 255, 200);
|
||||
$pdf->Ellipse($xc, $yc, 30, 15, 45, 0, 360, 'D', array(), array(), 2);
|
||||
$pdf->Ellipse($xc, $yc, 30, 15, 45, 0, 360, 'D', [], [], 2);
|
||||
|
||||
// ellipse arc
|
||||
$pdf->setDrawColor(255, 0, 0);
|
||||
$pdf->Ellipse($xc, $yc, 30, 15, 45, 45, 90, 'D', array(), array(), 2);
|
||||
|
||||
$pdf->Ellipse($xc, $yc, 30, 15, 45, 45, 90, 'D', [], [], 2);
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_013.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 013', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_014.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -24,7 +24,6 @@
|
|||
* @since 2008-03-04
|
||||
*/
|
||||
|
||||
|
||||
// Include the main TCPDF library (search for installation path).
|
||||
require_once('tcpdf_include.php');
|
||||
|
||||
|
|
@ -42,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 014', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -54,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -83,7 +82,7 @@ This name allows to manipulate them via JavaScript in order to perform some vali
|
|||
*/
|
||||
|
||||
// set default form properties
|
||||
$pdf->setFormDefaultProp(array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 200), 'strokeColor'=>array(255, 128, 128)));
|
||||
$pdf->setFormDefaultProp(['lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>[255, 255, 200], 'strokeColor'=>[255, 128, 128]]);
|
||||
|
||||
$pdf->setFont('helvetica', 'BI', 18);
|
||||
$pdf->Cell(0, 5, 'Example of Form', 0, 1, 'C');
|
||||
|
|
@ -103,41 +102,41 @@ $pdf->Ln(6);
|
|||
|
||||
// Gender
|
||||
$pdf->Cell(35, 5, 'Gender:');
|
||||
$pdf->ComboBox('gender', 30, 5, array(array('', '-'), array('M', 'Male'), array('F', 'Female')));
|
||||
$pdf->ComboBox('gender', 30, 5, [['', '-'], ['M', 'Male'], ['F', 'Female']]);
|
||||
$pdf->Ln(6);
|
||||
|
||||
// Drink
|
||||
$pdf->Cell(35, 5, 'Drink:');
|
||||
//$pdf->RadioButton('drink', 5, array('readonly' => 'true'), array(), 'Water');
|
||||
$pdf->RadioButton('drink', 5, array(), array(), 'Water');
|
||||
$pdf->RadioButton('drink', 5, [], [], 'Water');
|
||||
$pdf->Cell(35, 5, 'Water');
|
||||
$pdf->Ln(6);
|
||||
$pdf->Cell(35, 5, '');
|
||||
$pdf->RadioButton('drink', 5, array(), array(), 'Beer', true);
|
||||
$pdf->RadioButton('drink', 5, [], [], 'Beer', true);
|
||||
$pdf->Cell(35, 5, 'Beer');
|
||||
$pdf->Ln(6);
|
||||
$pdf->Cell(35, 5, '');
|
||||
$pdf->RadioButton('drink', 5, array(), array(), 'Wine');
|
||||
$pdf->RadioButton('drink', 5, [], [], 'Wine');
|
||||
$pdf->Cell(35, 5, 'Wine');
|
||||
$pdf->Ln(6);
|
||||
$pdf->Cell(35, 5, '');
|
||||
$pdf->RadioButton('drink', 5, array(), array(), 'Milk');
|
||||
$pdf->RadioButton('drink', 5, [], [], 'Milk');
|
||||
$pdf->Cell(35, 5, 'Milk');
|
||||
$pdf->Ln(10);
|
||||
|
||||
// Newsletter
|
||||
$pdf->Cell(35, 5, 'Newsletter:');
|
||||
$pdf->CheckBox('newsletter', 5, true, array(), array(), 'OK');
|
||||
$pdf->CheckBox('newsletter', 5, true, [], [], 'OK');
|
||||
|
||||
$pdf->Ln(10);
|
||||
// Address
|
||||
$pdf->Cell(35, 5, 'Address:');
|
||||
$pdf->TextField('address', 60, 18, array('multiline'=>true, 'lineWidth'=>0, 'borderStyle'=>'none'), array('v'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'dv'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'));
|
||||
$pdf->TextField('address', 60, 18, ['multiline'=>true, 'lineWidth'=>0, 'borderStyle'=>'none'], ['v'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'dv'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit.']);
|
||||
$pdf->Ln(19);
|
||||
|
||||
// Listbox
|
||||
$pdf->Cell(35, 5, 'List:');
|
||||
$pdf->ListBox('listbox', 60, 15, array('', 'item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7'), array('multipleSelection'=>'true'));
|
||||
$pdf->ListBox('listbox', 60, 15, ['', 'item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7'], ['multipleSelection'=>'true']);
|
||||
$pdf->Ln(20);
|
||||
|
||||
// E-mail
|
||||
|
|
@ -147,19 +146,19 @@ $pdf->Ln(6);
|
|||
|
||||
// Date of the day
|
||||
$pdf->Cell(35, 5, 'Date:');
|
||||
$pdf->TextField('date', 30, 5, array(), array('v'=>date('Y-m-d'), 'dv'=>date('Y-m-d')));
|
||||
$pdf->TextField('date', 30, 5, [], ['v'=>\date('Y-m-d'), 'dv'=>\date('Y-m-d')]);
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->setX(50);
|
||||
|
||||
// Button to validate and print
|
||||
$pdf->Button('print', 30, 10, 'Print', 'Print()', array('lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>array(128, 196, 255), 'strokeColor'=>array(64, 64, 64)));
|
||||
$pdf->Button('print', 30, 10, 'Print', 'Print()', ['lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>[128, 196, 255], 'strokeColor'=>[64, 64, 64]]);
|
||||
|
||||
// Reset Button
|
||||
$pdf->Button('reset', 30, 10, 'Reset', array('S'=>'ResetForm'), array('lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>array(128, 196, 255), 'strokeColor'=>array(64, 64, 64)));
|
||||
$pdf->Button('reset', 30, 10, 'Reset', ['S'=>'ResetForm'], ['lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>[128, 196, 255], 'strokeColor'=>[64, 64, 64]]);
|
||||
|
||||
// Submit Button
|
||||
$pdf->Button('submit', 30, 10, 'Submit', array('S'=>'SubmitForm', 'F'=>'http://localhost/printvars.php', 'Flags'=>array('ExportFormat')), array('lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>array(128, 196, 255), 'strokeColor'=>array(64, 64, 64)));
|
||||
$pdf->Button('submit', 30, 10, 'Submit', ['S'=>'SubmitForm', 'F'=>'http://localhost/printvars.php', 'Flags'=>['ExportFormat']], ['lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>[128, 196, 255], 'strokeColor'=>[64, 64, 64]]);
|
||||
|
||||
// Form validation functions
|
||||
$js = <<<EOD
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_015.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -42,8 +42,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 015', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -54,14 +54,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ $pdf->setFont('times', 'B', 20);
|
|||
$pdf->AddPage();
|
||||
|
||||
// set a bookmark for the current position
|
||||
$pdf->Bookmark('Chapter 1', 0, 0, '', 'B', array(0,64,128));
|
||||
$pdf->Bookmark('Chapter 1', 0, 0, '', 'B', [0,64,128]);
|
||||
|
||||
// print a line using Cell()
|
||||
$pdf->Cell(0, 10, 'Chapter 1', 0, 1, 'L');
|
||||
|
|
@ -90,26 +90,26 @@ $pdf->setFont('times', 'B', 20);
|
|||
// add other pages and bookmarks
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Paragraph 1.1', 1, 0, '', '', array(0,0,0));
|
||||
$pdf->Bookmark('Paragraph 1.1', 1, 0, '', '', [0,0,0]);
|
||||
$pdf->Cell(0, 10, 'Paragraph 1.1', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Paragraph 1.2', 1, 0, '', '', array(0,0,0));
|
||||
$pdf->Bookmark('Paragraph 1.2', 1, 0, '', '', [0,0,0]);
|
||||
$pdf->Cell(0, 10, 'Paragraph 1.2', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Sub-Paragraph 1.2.1', 2, 0, '', 'I', array(0,0,0));
|
||||
$pdf->Bookmark('Sub-Paragraph 1.2.1', 2, 0, '', 'I', [0,0,0]);
|
||||
$pdf->Cell(0, 10, 'Sub-Paragraph 1.2.1', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Paragraph 1.3', 1, 0, '', '', array(0,0,0));
|
||||
$pdf->Bookmark('Paragraph 1.3', 1, 0, '', '', [0,0,0]);
|
||||
$pdf->Cell(0, 10, 'Paragraph 1.3', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
// add a named destination so you can open this document at this page using the link: "example_015.pdf#chapter2"
|
||||
$pdf->setDestination('chapter2', 0, '');
|
||||
// add a bookmark that points to a named destination
|
||||
$pdf->Bookmark('Chapter 2', 0, 0, '', 'BI', array(128,0,0), -1, '#chapter2');
|
||||
$pdf->Bookmark('Chapter 2', 0, 0, '', 'BI', [128,0,0], -1, '#chapter2');
|
||||
$pdf->Cell(0, 10, 'Chapter 2', 0, 1, 'L');
|
||||
$pdf->setFont('times', 'I', 14);
|
||||
$pdf->Write(0, 'Once saved, you can open this document at this page using the link: "example_015.pdf#chapter2".');
|
||||
|
|
@ -117,17 +117,17 @@ $pdf->Write(0, 'Once saved, you can open this document at this page using the li
|
|||
$pdf->AddPage();
|
||||
$pdf->setDestination('chapter3', 0, '');
|
||||
$pdf->setFont('times', 'B', 20);
|
||||
$pdf->Bookmark('Chapter 3', 0, 0, '', 'B', array(0,64,128));
|
||||
$pdf->Bookmark('Chapter 3', 0, 0, '', 'B', [0,64,128]);
|
||||
$pdf->Cell(0, 10, 'Chapter 3', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->setDestination('chapter4', 0, '');
|
||||
$pdf->setFont('times', 'B', 20);
|
||||
$pdf->Bookmark('Chapter 4', 0, 0, '', 'B', array(0,64,128));
|
||||
$pdf->Bookmark('Chapter 4', 0, 0, '', 'B', [0,64,128]);
|
||||
$pdf->Cell(0, 10, 'Chapter 4', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Chapter 5', 0, 0, '', 'B', array(0,128,0));
|
||||
$pdf->Bookmark('Chapter 5', 0, 0, '', 'B', [0,128,0]);
|
||||
$pdf->Cell(0, 10, 'Chapter 5', 0, 1, 'L');
|
||||
$txt = 'Example of File Attachment.
|
||||
Double click on the icon to open the attached file.';
|
||||
|
|
@ -135,21 +135,21 @@ $pdf->setFont('helvetica', '', 10);
|
|||
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||
|
||||
// attach an external file TXT file
|
||||
$pdf->Annotation(20, 50, 5, 5, 'TXT file', array('Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => 'data/utf8test.txt'));
|
||||
$pdf->Annotation(20, 50, 5, 5, 'TXT file', ['Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => 'data/utf8test.txt']);
|
||||
|
||||
// attach an external file
|
||||
$pdf->Annotation(50, 50, 5, 5, 'PDF file', array('Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => 'example_012.pdf'));
|
||||
$pdf->Annotation(50, 50, 5, 5, 'PDF file', ['Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => 'example_012.pdf']);
|
||||
|
||||
// add a bookmark that points to an embedded file
|
||||
// NOTE: prefix the file name with the * character for generic file and with % character for PDF file
|
||||
$pdf->Bookmark('TXT file', 0, 0, '', 'B', array(128,0,255), -1, '*utf8test.txt');
|
||||
$pdf->Bookmark('TXT file', 0, 0, '', 'B', [128,0,255], -1, '*utf8test.txt');
|
||||
|
||||
// add a bookmark that points to an embedded file
|
||||
// NOTE: prefix the file name with the * character for generic file and with % character for PDF file
|
||||
$pdf->Bookmark('PDF file', 0, 0, '', 'B', array(128,0,255), -1, '%example_012.pdf');
|
||||
$pdf->Bookmark('PDF file', 0, 0, '', 'B', [128,0,255], -1, '%example_012.pdf');
|
||||
|
||||
// add a bookmark that points to an external URL
|
||||
$pdf->Bookmark('External URL', 0, 0, '', 'B', array(0,0,255), -1, 'http://www.tcpdf.org');
|
||||
$pdf->Bookmark('External URL', 0, 0, '', 'B', [0,0,255], -1, 'http://www.tcpdf.org');
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_016.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -30,7 +30,6 @@ require_once('tcpdf_include.php');
|
|||
// create new PDF document
|
||||
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||
|
||||
|
||||
// *** Set PDF protection (encryption) *********************
|
||||
|
||||
/*
|
||||
|
|
@ -62,7 +61,7 @@ $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8',
|
|||
|
||||
*/
|
||||
|
||||
$pdf->setProtection(array('print', 'copy'), '', null, 0, null);
|
||||
$pdf->setProtection(['print', 'copy'], '', null, 0, null);
|
||||
|
||||
// Example with public-key
|
||||
// To open the document you need to install the private key (tcpdf.p12) on the Acrobat Reader. The password is: 1234
|
||||
|
|
@ -70,7 +69,6 @@ $pdf->setProtection(array('print', 'copy'), '', null, 0, null);
|
|||
|
||||
// *********************************************************
|
||||
|
||||
|
||||
// set document information
|
||||
$pdf->setCreator(PDF_CREATOR);
|
||||
$pdf->setAuthor('Nicola Asuni');
|
||||
|
|
@ -82,8 +80,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 016', PDF_HEADER_STRING);
|
||||
|
||||
// set header and footer fonts
|
||||
$pdf->setHeaderFont(Array('helvetica', '', PDF_FONT_SIZE_MAIN));
|
||||
$pdf->setFooterFont(Array('helvetica', '', PDF_FONT_SIZE_DATA));
|
||||
$pdf->setHeaderFont(['helvetica', '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont(['helvetica', '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -94,14 +92,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +121,6 @@ EOD;
|
|||
// print a block of text using Write()
|
||||
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
//Close and output PDF document
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_017.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 017', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_018.php
|
||||
// Begin : 2008-03-06
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 018', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,13 +53,13 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$pdf->setAutoPageBreak(true, PDF_MARGIN_BOTTOM);
|
||||
|
||||
// set image scale factor
|
||||
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||
|
||||
// set some language dependent data:
|
||||
$lg = Array();
|
||||
$lg = [];
|
||||
$lg['a_meta_charset'] = 'UTF-8';
|
||||
$lg['a_meta_dir'] = 'rtl';
|
||||
$lg['a_meta_language'] = 'fa';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_019.php
|
||||
// Begin : 2008-03-07
|
||||
|
|
@ -44,8 +44,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 019', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -56,13 +56,13 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$pdf->setAutoPageBreak(true, PDF_MARGIN_BOTTOM);
|
||||
|
||||
// set image scale factor
|
||||
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||
|
||||
// set some language dependent data:
|
||||
$lg = Array();
|
||||
$lg = [];
|
||||
$lg['a_meta_charset'] = 'ISO-8859-1';
|
||||
$lg['a_meta_dir'] = 'ltr';
|
||||
$lg['a_meta_language'] = 'en';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_020.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -30,8 +30,7 @@ require_once('tcpdf_include.php');
|
|||
|
||||
// extend TCPF with custom functions
|
||||
class MYPDF extends TCPDF {
|
||||
|
||||
public function MultiRow($left, $right) {
|
||||
public function MultiRow($left, $right) : void {
|
||||
// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0)
|
||||
|
||||
$page_start = $this->getPage();
|
||||
|
|
@ -52,20 +51,19 @@ class MYPDF extends TCPDF {
|
|||
$y_end_2 = $this->GetY();
|
||||
|
||||
// set the new row position by case
|
||||
if (max($page_end_1,$page_end_2) == $page_start) {
|
||||
$ynew = max($y_end_1, $y_end_2);
|
||||
if (\max($page_end_1,$page_end_2) == $page_start) {
|
||||
$ynew = \max($y_end_1, $y_end_2);
|
||||
} elseif ($page_end_1 == $page_end_2) {
|
||||
$ynew = max($y_end_1, $y_end_2);
|
||||
$ynew = \max($y_end_1, $y_end_2);
|
||||
} elseif ($page_end_1 > $page_end_2) {
|
||||
$ynew = $y_end_1;
|
||||
} else {
|
||||
$ynew = $y_end_2;
|
||||
}
|
||||
|
||||
$this->setPage(max($page_end_1,$page_end_2));
|
||||
$this->setPage(\max($page_end_1,$page_end_2));
|
||||
$this->setXY($this->GetX(),$ynew);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// create new PDF document
|
||||
|
|
@ -82,8 +80,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 020', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -94,14 +92,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_021.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 021', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_022.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 022', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ $pdf->AddPage();
|
|||
$pdf->Write(0, 'Example of CMYK, RGB and Grayscale colours', '', 0, 'L', true, 0, false, false, 0);
|
||||
|
||||
// define style for border
|
||||
$border_style = array('all' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'phase' => 0));
|
||||
$border_style = ['all' => ['width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'phase' => 0]];
|
||||
|
||||
// --- CMYK ------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_023.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 023', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_024.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 024', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_025.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 025', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_026.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 026', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -75,7 +75,6 @@ $pdf->AddPage();
|
|||
// set color for text stroke
|
||||
$pdf->setDrawColor(255,0,0);
|
||||
|
||||
|
||||
$pdf->setTextRenderingMode($stroke=0, $fill=true, $clip=false);
|
||||
$pdf->Write(0, 'Fill text', '', 0, '', true, 0, false, false, 0);
|
||||
|
||||
|
|
@ -88,7 +87,6 @@ $pdf->Write(0, 'Fill, then stroke text', '', 0, '', true, 0, false, false, 0);
|
|||
$pdf->setTextRenderingMode($stroke=0, $fill=false, $clip=false);
|
||||
$pdf->Write(0, 'Neither fill nor stroke text (invisible)', '', 0, '', true, 0, false, false, 0);
|
||||
|
||||
|
||||
// * * * CLIPPING MODES * * * * * * * * * * * * * * * * * *
|
||||
|
||||
$pdf->StartTransform();
|
||||
|
|
@ -125,7 +123,6 @@ $pdf->setTextRenderingMode($stroke=0, $fill=true, $clip=false);
|
|||
// strokecolor : stroke color
|
||||
// fill : true (default) to fill the font, false otherwise
|
||||
|
||||
|
||||
// create some HTML content with text rendering modes
|
||||
$html = '<span stroke="0" fill="true">HTML Fill text</span><br />';
|
||||
$html .= '<span stroke="0.2" fill="false">HTML Stroke text</span><br />';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_027.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 027', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,21 +53,21 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
// set a barcode on the page footer
|
||||
$pdf->setBarcode(date('Y-m-d H:i:s'));
|
||||
$pdf->setBarcode(\date('Y-m-d H:i:s'));
|
||||
|
||||
// set font
|
||||
$pdf->setFont('helvetica', '', 11);
|
||||
|
|
@ -85,7 +85,7 @@ $pdf->setY(30);
|
|||
$pdf->setFont('helvetica', '', 10);
|
||||
|
||||
// define barcode style
|
||||
$style = array(
|
||||
$style = [
|
||||
'position' => '',
|
||||
'align' => 'C',
|
||||
'stretch' => false,
|
||||
|
|
@ -94,13 +94,13 @@ $style = array(
|
|||
'border' => true,
|
||||
'hpadding' => 'auto',
|
||||
'vpadding' => 'auto',
|
||||
'fgcolor' => array(0,0,0),
|
||||
'fgcolor' => [0,0,0],
|
||||
'bgcolor' => false, //array(255,255,255),
|
||||
'text' => true,
|
||||
'font' => 'helvetica',
|
||||
'fontsize' => 8,
|
||||
'stretchtext' => 4
|
||||
);
|
||||
'stretchtext' => 4,
|
||||
];
|
||||
|
||||
// PRINT VARIOUS 1D BARCODES
|
||||
|
||||
|
|
@ -156,7 +156,6 @@ $pdf->Ln();
|
|||
$pdf->Cell(0, 0, 'Interleaved 2 of 5 + CHECKSUM', 0, 1);
|
||||
$pdf->write1DBarcode('1234567', 'I25+', '', '', '', 18, 0.4, $style, 'N');
|
||||
|
||||
|
||||
// add a page ----------
|
||||
$pdf->AddPage();
|
||||
|
||||
|
|
@ -293,8 +292,8 @@ $pdf->write1DBarcode('SN34RDX1A', 'KIX', '', '', '', 15, 0.6, $style, 'N');
|
|||
$pdf->AddPage();
|
||||
|
||||
// set a background color
|
||||
$style['bgcolor'] = array(255,255,240);
|
||||
$style['fgcolor'] = array(127,0,0);
|
||||
$style['bgcolor'] = [255,255,240];
|
||||
$style['fgcolor'] = [127,0,0];
|
||||
|
||||
// Left position
|
||||
$style['position'] = 'L';
|
||||
|
|
@ -315,7 +314,7 @@ $pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
|||
$pdf->Ln(2);
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
$style['fgcolor'] = array(0,127,0);
|
||||
$style['fgcolor'] = [0,127,0];
|
||||
$style['position'] = '';
|
||||
$style['stretch'] = false; // disable stretch
|
||||
$style['fitwidth'] = false; // disable fitwidth
|
||||
|
|
@ -339,7 +338,7 @@ $pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
|||
$pdf->Ln(2);
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
$style['fgcolor'] = array(0,64,127);
|
||||
$style['fgcolor'] = [0,64,127];
|
||||
$style['position'] = '';
|
||||
$style['stretch'] = false; // disable stretch
|
||||
$style['fitwidth'] = true; // disable fitwidth
|
||||
|
|
@ -363,7 +362,7 @@ $pdf->write1DBarcode('RIGHT', 'C128A', 105, '', 90, 15, 0.4, $style, 'N');
|
|||
$pdf->Ln(2);
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
$style['fgcolor'] = array(127,0,127);
|
||||
$style['fgcolor'] = [127,0,127];
|
||||
|
||||
// Left alignment
|
||||
$style['position'] = 'L';
|
||||
|
|
@ -385,7 +384,7 @@ $pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
|||
// TEST BARCODE STYLE
|
||||
|
||||
// define barcode style
|
||||
$style = array(
|
||||
$style = [
|
||||
'position' => '',
|
||||
'align' => '',
|
||||
'stretch' => true,
|
||||
|
|
@ -394,18 +393,18 @@ $style = array(
|
|||
'border' => true,
|
||||
'hpadding' => 'auto',
|
||||
'vpadding' => 'auto',
|
||||
'fgcolor' => array(0,0,128),
|
||||
'bgcolor' => array(255,255,128),
|
||||
'fgcolor' => [0,0,128],
|
||||
'bgcolor' => [255,255,128],
|
||||
'text' => true,
|
||||
'label' => 'CUSTOM LABEL',
|
||||
'font' => 'helvetica',
|
||||
'fontsize' => 8,
|
||||
'stretchtext' => 4
|
||||
);
|
||||
'stretchtext' => 4,
|
||||
];
|
||||
|
||||
// CODE 39 EXTENDED + CHECKSUM
|
||||
$pdf->Cell(0, 0, 'CODE 39 EXTENDED + CHECKSUM', 0, 1);
|
||||
$pdf->setLineStyle(array('width' => 1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));
|
||||
$pdf->setLineStyle(['width' => 1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [255, 0, 0]]);
|
||||
$pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', 120, 25, 0.4, $style, 'N');
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_028.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -48,14 +48,14 @@ $pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
|||
$pdf->setMargins(10, PDF_MARGIN_TOP, 10);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -90,10 +90,8 @@ $pdf->Cell(0, 0, 'A7 PORTRAIT', 1, 1, 'C');
|
|||
$pdf->AddPage('L', 'A7');
|
||||
$pdf->Cell(0, 0, 'A7 LANDSCAPE', 1, 1, 'C');
|
||||
|
||||
|
||||
// --- test backward editing ---
|
||||
|
||||
|
||||
$pdf->setPage(1, true);
|
||||
$pdf->setY(50);
|
||||
$pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_029.php
|
||||
// Begin : 2008-06-09
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 029', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,21 +53,21 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
// set array for viewer preferences
|
||||
$preferences = array(
|
||||
$preferences = [
|
||||
'HideToolbar' => true,
|
||||
'HideMenubar' => true,
|
||||
'HideWindowUI' => true,
|
||||
|
|
@ -82,9 +82,9 @@ $preferences = array(
|
|||
'PrintScaling' => 'AppDefault', // None, AppDefault
|
||||
'Duplex' => 'DuplexFlipLongEdge', // Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge
|
||||
'PickTrayByPDFSize' => true,
|
||||
'PrintPageRange' => array(1,1,2,3),
|
||||
'NumCopies' => 2
|
||||
);
|
||||
'PrintPageRange' => [1,1,2,3],
|
||||
'NumCopies' => 2,
|
||||
];
|
||||
|
||||
// Check the example n. 60 for advanced page settings
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_030.php
|
||||
// Begin : 2008-06-09
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 030', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -77,15 +77,15 @@ $pdf->AddPage();
|
|||
$pdf->Cell(0, 0, 'TCPDF Gradients', 0, 1, 'C', 0, '', 0, false, 'T', 'M');
|
||||
|
||||
// set colors for gradients (r,g,b) or (grey 0-255)
|
||||
$red = array(255, 0, 0);
|
||||
$blue = array(0, 0, 200);
|
||||
$yellow = array(255, 255, 0);
|
||||
$green = array(0, 255, 0);
|
||||
$white = array(255);
|
||||
$black = array(0);
|
||||
$red = [255, 0, 0];
|
||||
$blue = [0, 0, 200];
|
||||
$yellow = [255, 255, 0];
|
||||
$green = [0, 255, 0];
|
||||
$white = [255];
|
||||
$black = [0];
|
||||
|
||||
// set the coordinates x1,y1,x2,y2 of the gradient (see linear_gradient_coords.jpg)
|
||||
$coords = array(0, 0, 1, 0);
|
||||
$coords = [0, 0, 1, 0];
|
||||
|
||||
// paint a linear gradient
|
||||
$pdf->LinearGradient(20, 45, 80, 80, $red, $blue, $coords);
|
||||
|
|
@ -94,7 +94,7 @@ $pdf->LinearGradient(20, 45, 80, 80, $red, $blue, $coords);
|
|||
$pdf->Text(20, 130, 'LinearGradient()');
|
||||
|
||||
// set the coordinates fx,fy,cx,cy,r of the gradient (see radial_gradient_coords.jpg)
|
||||
$coords = array(0.5, 0.5, 1, 1, 1.2);
|
||||
$coords = [0.5, 0.5, 1, 1, 1.2];
|
||||
|
||||
// paint a radial gradient
|
||||
$pdf->RadialGradient(110, 45, 80, 80, $white, $black, $coords);
|
||||
|
|
@ -109,12 +109,12 @@ $pdf->CoonsPatchMesh(20, 155, 80, 80, $yellow, $blue, $green, $red);
|
|||
$pdf->Text(20, 240, 'CoonsPatchMesh()');
|
||||
|
||||
// set the coordinates for the cubic Bézier points x1,y1 ... x12, y12 of the patch (see coons_patch_mesh_coords.jpg)
|
||||
$coords = array(
|
||||
$coords = [
|
||||
0.00,0.00, 0.33,0.20, //lower left
|
||||
0.67,0.00, 1.00,0.00, 0.80,0.33, //lower right
|
||||
0.80,0.67, 1.00,1.00, 0.67,0.80, //upper right
|
||||
0.33,1.00, 0.00,1.00, 0.20,0.67, //upper left
|
||||
0.00,0.33); //lower left
|
||||
0.00,0.33]; //lower left
|
||||
$coords_min = 0; //minimum value of the coordinates
|
||||
$coords_max = 1; //maximum value of the coordinates
|
||||
|
||||
|
|
@ -129,46 +129,46 @@ $pdf->AddPage();
|
|||
|
||||
// first patch: f = 0
|
||||
$patch_array[0]['f'] = 0;
|
||||
$patch_array[0]['points'] = array(
|
||||
$patch_array[0]['points'] = [
|
||||
0.00,0.00, 0.33,0.00,
|
||||
0.67,0.00, 1.00,0.00, 1.00,0.33,
|
||||
0.8,0.67, 1.00,1.00, 0.67,0.8,
|
||||
0.33,1.80, 0.00,1.00, 0.00,0.67,
|
||||
0.00,0.33);
|
||||
$patch_array[0]['colors'][0] = array('r' => 255, 'g' => 255, 'b' => 0);
|
||||
$patch_array[0]['colors'][1] = array('r' => 0, 'g' => 0, 'b' => 255);
|
||||
$patch_array[0]['colors'][2] = array('r' => 0, 'g' => 255,'b' => 0);
|
||||
$patch_array[0]['colors'][3] = array('r' => 255, 'g' => 0,'b' => 0);
|
||||
0.00,0.33];
|
||||
$patch_array[0]['colors'][0] = ['r' => 255, 'g' => 255, 'b' => 0];
|
||||
$patch_array[0]['colors'][1] = ['r' => 0, 'g' => 0, 'b' => 255];
|
||||
$patch_array[0]['colors'][2] = ['r' => 0, 'g' => 255,'b' => 0];
|
||||
$patch_array[0]['colors'][3] = ['r' => 255, 'g' => 0,'b' => 0];
|
||||
|
||||
// second patch - above the other: f = 2
|
||||
$patch_array[1]['f'] = 2;
|
||||
$patch_array[1]['points'] = array(
|
||||
$patch_array[1]['points'] = [
|
||||
0.00,1.33,
|
||||
0.00,1.67, 0.00,2.00, 0.33,2.00,
|
||||
0.67,2.00, 1.00,2.00, 1.00,1.67,
|
||||
1.5,1.33);
|
||||
$patch_array[1]['colors'][0]=array('r' => 0, 'g' => 0, 'b' => 0);
|
||||
$patch_array[1]['colors'][1]=array('r' => 255, 'g' => 0, 'b' => 255);
|
||||
1.5,1.33];
|
||||
$patch_array[1]['colors'][0]=['r' => 0, 'g' => 0, 'b' => 0];
|
||||
$patch_array[1]['colors'][1]=['r' => 255, 'g' => 0, 'b' => 255];
|
||||
|
||||
// third patch - right of the above: f = 3
|
||||
$patch_array[2]['f'] = 3;
|
||||
$patch_array[2]['points'] = array(
|
||||
$patch_array[2]['points'] = [
|
||||
1.33,0.80,
|
||||
1.67,1.50, 2.00,1.00, 2.00,1.33,
|
||||
2.00,1.67, 2.00,2.00, 1.67,2.00,
|
||||
1.33,2.00);
|
||||
$patch_array[2]['colors'][0] = array('r' => 0, 'g' => 255, 'b' => 255);
|
||||
$patch_array[2]['colors'][1] = array('r' => 0, 'g' => 0, 'b' => 0);
|
||||
1.33,2.00];
|
||||
$patch_array[2]['colors'][0] = ['r' => 0, 'g' => 255, 'b' => 255];
|
||||
$patch_array[2]['colors'][1] = ['r' => 0, 'g' => 0, 'b' => 0];
|
||||
|
||||
// fourth patch - below the above, which means left(?) of the above: f = 1
|
||||
$patch_array[3]['f'] = 1;
|
||||
$patch_array[3]['points'] = array(
|
||||
$patch_array[3]['points'] = [
|
||||
2.00,0.67,
|
||||
2.00,0.33, 2.00,0.00, 1.67,0.00,
|
||||
1.33,0.00, 1.00,0.00, 1.00,0.33,
|
||||
0.8,0.67);
|
||||
$patch_array[3]['colors'][0] = array('r' => 0, 'g' => 0, 'b' => 0);
|
||||
$patch_array[3]['colors'][1] = array('r' => 0, 'g' => 0, 'b' => 255);
|
||||
0.8,0.67];
|
||||
$patch_array[3]['colors'][0] = ['r' => 0, 'g' => 0, 'b' => 0];
|
||||
$patch_array[3]['colors'][1] = ['r' => 0, 'g' => 0, 'b' => 255];
|
||||
|
||||
$coords_min = 0;
|
||||
$coords_max = 2;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_031.php
|
||||
// Begin : 2008-06-09
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 031', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_032.php
|
||||
// Begin : 2008-06-09
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 032', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_033.php
|
||||
// Begin : 2008-06-24
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 033', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,6 @@ $pdf->setFont('cid0jp', '', 9);
|
|||
|
||||
$pdf->MultiCell(80, 0, "[CID-0 font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, '', '', true, 0);
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
//Close and output PDF document
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_034.php
|
||||
// Begin : 2008-07-18
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 034', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_035.php
|
||||
// Begin : 2008-07-22
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 035', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ $pdf->Write(0, 'Example of SetLineStyle() method', '', 0, 'L', true, 0, false, f
|
|||
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->setLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 4, 'color' => array(255, 0, 0)));
|
||||
$pdf->setLineStyle(['width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 4, 'color' => [255, 0, 0]]);
|
||||
$pdf->setFillColor(255,255,128);
|
||||
$pdf->setTextColor(0,0,128);
|
||||
|
||||
|
|
@ -86,17 +86,17 @@ $pdf->Cell(0, 0, $text, 1, 1, 'L', 1, 0);
|
|||
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->setLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 255)));
|
||||
$pdf->setLineStyle(['width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [0, 0, 255]]);
|
||||
$pdf->setFillColor(255,255,0);
|
||||
$pdf->setTextColor(0,0,255);
|
||||
$pdf->MultiCell(60, 4, $text, 1, 'C', 1, 0);
|
||||
|
||||
$pdf->setLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 255, 0)));
|
||||
$pdf->setLineStyle(['width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [255, 255, 0]]);
|
||||
$pdf->setFillColor(0,0,255);
|
||||
$pdf->setTextColor(255,255,0);
|
||||
$pdf->MultiCell(60, 4, $text, 'TB', 'C', 1, 0);
|
||||
|
||||
$pdf->setLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 255)));
|
||||
$pdf->setLineStyle(['width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [255, 0, 255]]);
|
||||
$pdf->setFillColor(0,255,0);
|
||||
$pdf->setTextColor(255,0,255);
|
||||
$pdf->MultiCell(60, 4, $text, 1, 'C', 1, 1);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_036.php
|
||||
// Begin : 2008-08-08
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 036', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ Move your mouse over the yellow box or double click on it to display the annotat
|
|||
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||
|
||||
// text annotation
|
||||
$pdf->Annotation(83, 27, 10, 10, "Text annotation example\naccented letters test: àèéìòù", array('Subtype'=>'Text', 'Name' => 'Comment', 'T' => 'title example', 'Subj' => 'example', 'C' => array(255, 255, 0)));
|
||||
$pdf->Annotation(83, 27, 10, 10, "Text annotation example\naccented letters test: àèéìòù", ['Subtype'=>'Text', 'Name' => 'Comment', 'T' => 'title example', 'Subj' => 'example', 'C' => [255, 255, 0]]);
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_037.php
|
||||
// Begin : 2008-09-12
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 037', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -77,7 +77,6 @@ $html = '<h1>Example of Spot Colors</h1>Spot colors are single ink colors, rathe
|
|||
// Print text using writeHTMLCell()
|
||||
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, 'J', true);
|
||||
|
||||
|
||||
$pdf->setFont('helvetica', '', 10);
|
||||
|
||||
// Define some new spot colors
|
||||
|
|
@ -114,7 +113,6 @@ $pdf->setFillSpotColor('My TCPDF Light Yellow', 100);
|
|||
$pdf->Rect(30, $starty, 40, 20, 'DF');
|
||||
$pdf->Text(73, $starty + 8, 'My TCPDF Light Yellow');
|
||||
|
||||
|
||||
// --- default values defined on spotcolors.php ---
|
||||
|
||||
$starty += 24;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_038.php
|
||||
// Begin : 2008-09-15
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 038', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_039.php
|
||||
// Begin : 2008-10-16
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 039', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_040.php
|
||||
// Begin : 2008-10-28
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 040', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
|||
$pdf->setDisplayMode($zoom='fullpage', $layout='TwoColumnRight', $mode='UseNone');
|
||||
|
||||
// set pdf viewer preferences
|
||||
$pdf->setViewerPreferences(array('Duplex' => 'DuplexFlipLongEdge'));
|
||||
$pdf->setViewerPreferences(['Duplex' => 'DuplexFlipLongEdge']);
|
||||
|
||||
// set booklet mode
|
||||
$pdf->setBooklet(true, 10, 30);
|
||||
|
|
@ -86,14 +86,12 @@ $pdf->Write(0, 'Example of booklet mode', '', 0, 'L', true, 0, false, false, 0);
|
|||
// print a line using Cell()
|
||||
$pdf->Cell(0, 0, 'PAGE 1', 1, 1, 'C');
|
||||
|
||||
|
||||
// add a page (right page)
|
||||
$pdf->AddPage();
|
||||
|
||||
// print a line using Cell()
|
||||
$pdf->Cell(0, 0, 'PAGE 2', 1, 1, 'C');
|
||||
|
||||
|
||||
// add a page (left page)
|
||||
$pdf->AddPage();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_041.php
|
||||
// Begin : 2008-12-07
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 041', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -72,13 +72,12 @@ $pdf->setFont('times', '', 16);
|
|||
// add a page
|
||||
$pdf->AddPage();
|
||||
|
||||
|
||||
$txt = 'Example of File Attachment.
|
||||
Double click on the icon to open the attached file.';
|
||||
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||
|
||||
// attach an external file
|
||||
$pdf->Annotation(85, 27, 5, 5, 'text file', array('Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => 'data/utf8test.txt'));
|
||||
$pdf->Annotation(85, 27, 5, 5, 'text file', ['Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => 'data/utf8test.txt']);
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_042.php
|
||||
// Begin : 2008-12-23
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 042', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ $pdf->setFont('helvetica', '', 18);
|
|||
$pdf->AddPage();
|
||||
|
||||
// create background text
|
||||
$background_text = str_repeat('TCPDF test PNG Alpha Channel ', 50);
|
||||
$background_text = \str_repeat('TCPDF test PNG Alpha Channel ', 50);
|
||||
$pdf->MultiCell(0, 5, $background_text, 0, 'J', 0, 2, '', '', true, 0, false);
|
||||
|
||||
// --- Method (A) ------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_043.php
|
||||
// Begin : 2009-01-02
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 043', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_044.php
|
||||
// Begin : 2009-01-02
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 044', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_045.php
|
||||
// Begin : 2008-03-04
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 045', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ $pdf->setFont('times', 'B', 20);
|
|||
$pdf->AddPage();
|
||||
|
||||
// set a bookmark for the current position
|
||||
$pdf->Bookmark('Chapter 1', 0, 0, '', 'B', array(0,64,128));
|
||||
$pdf->Bookmark('Chapter 1', 0, 0, '', 'B', [0,64,128]);
|
||||
|
||||
// print a line using Cell()
|
||||
$pdf->Cell(0, 10, 'Chapter 1', 0, 1, 'L');
|
||||
|
|
@ -84,30 +84,29 @@ $pdf->setLink($index_link, 0, '*1');
|
|||
$pdf->Cell(0, 10, 'Link to INDEX', 0, 1, 'R', false, $index_link);
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Paragraph 1.1', 1, 0, '', '', array(128,0,0));
|
||||
$pdf->Bookmark('Paragraph 1.1', 1, 0, '', '', [128,0,0]);
|
||||
$pdf->Cell(0, 10, 'Paragraph 1.1', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Paragraph 1.2', 1, 0, '', '', array(128,0,0));
|
||||
$pdf->Bookmark('Paragraph 1.2', 1, 0, '', '', [128,0,0]);
|
||||
$pdf->Cell(0, 10, 'Paragraph 1.2', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Sub-Paragraph 1.2.1', 2, 0, '', 'I', array(0,128,0));
|
||||
$pdf->Bookmark('Sub-Paragraph 1.2.1', 2, 0, '', 'I', [0,128,0]);
|
||||
$pdf->Cell(0, 10, 'Sub-Paragraph 1.2.1', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Paragraph 1.3', 1, 0, '', '', array(128,0,0));
|
||||
$pdf->Bookmark('Paragraph 1.3', 1, 0, '', '', [128,0,0]);
|
||||
$pdf->Cell(0, 10, 'Paragraph 1.3', 0, 1, 'L');
|
||||
|
||||
// fixed link to the first page using the * character
|
||||
$html = '<a href="#*1" style="color:blue;">link to INDEX (page 1)</a>';
|
||||
$pdf->writeHTML($html, true, false, true, false, '');
|
||||
|
||||
|
||||
// add some pages and bookmarks
|
||||
for ($i = 2; $i < 12; $i++) {
|
||||
for ($i = 2; $i < 12; ++$i) {
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Chapter '.$i, 0, 0, '', 'B', array(0,64,128));
|
||||
$pdf->Bookmark('Chapter '.$i, 0, 0, '', 'B', [0,64,128]);
|
||||
$pdf->Cell(0, 10, 'Chapter '.$i, 0, 1, 'L');
|
||||
}
|
||||
|
||||
|
|
@ -125,7 +124,7 @@ $pdf->setFont('dejavusans', '', 12);
|
|||
|
||||
// add a simple Table Of Content at first page
|
||||
// (check the example n. 59 for the HTML version)
|
||||
$pdf->addTOC(1, 'courier', '.', 'INDEX', 'B', array(128,0,0));
|
||||
$pdf->addTOC(1, 'courier', '.', 'INDEX', 'B', [128,0,0]);
|
||||
|
||||
// end of TOC page
|
||||
$pdf->endTOCPage();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_046.php
|
||||
// Begin : 2009-02-28
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 046', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +102,6 @@ $hyphen_patterns = $pdf->getHyphenPatternsFromTEX('hyphens/hyph-en-gb.tex');
|
|||
$html = $pdf->hyphenateText($html, $hyphen_patterns, array(), 1, 2, 1, 8);
|
||||
*/
|
||||
|
||||
|
||||
// HTML text with soft hyphens (­)
|
||||
$html = 'On the other hand, we de­nounce with righ­teous in­dig­na­tion and dis­like men who are so be­guiled and de­mo­r­al­ized by the charms of plea­sure of the mo­ment, so blind­ed by de­sire, that they can­not fore­see the pain and trou­ble that are bound to en­sue; and equal blame be­longs to those who fail in their du­ty through weak­ness of will, which is the same as say­ing through shrink­ing from toil and pain. Th­ese cas­es are per­fect­ly sim­ple and easy to distin­guish. In a free hour, when our pow­er of choice is un­tram­melled and when noth­ing pre­vents our be­ing able to do what we like best, ev­ery plea­sure is to be wel­comed and ev­ery pain avoid­ed. But in cer­tain cir­cum­s­tances and ow­ing to the claims of du­ty or the obli­ga­tions of busi­ness it will fre­quent­ly oc­cur that plea­sures have to be re­pu­di­at­ed and an­noy­ances ac­cept­ed. The wise man there­fore al­ways holds in th­ese mat­ters to this prin­ci­ple of se­lec­tion: he re­jects plea­sures to se­cure other greater plea­sures, or else he en­dures pains to avoid worse pains.';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_047.php
|
||||
// Begin : 2009-03-19
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 047', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_048.php
|
||||
// Begin : 2009-03-20
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 048', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_049.php
|
||||
// Begin : 2009-04-03
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 049', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +72,6 @@ $pdf->setFont('helvetica', '', 10);
|
|||
// add a page
|
||||
$pdf->AddPage();
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
IMPORTANT:
|
||||
|
|
@ -86,28 +85,26 @@ serializeTCPDFtagParameters() method (see the example below).
|
|||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
$html = '<h1>Test TCPDF Methods in HTML</h1>
|
||||
<h2 style="color:red;">IMPORTANT:</h2>
|
||||
<span style="color:red;">If you are using user-generated content, the tcpdf tag can be unsafe.<br />
|
||||
You can disable this tag by setting to false the <b>K_TCPDF_CALLS_IN_HTML</b> constant on TCPDF configuration file.</span>
|
||||
<h2>write1DBarcode method in HTML</h2>';
|
||||
|
||||
$params = $pdf->serializeTCPDFtagParameters(array('CODE 39', 'C39', '', '', 80, 30, 0.4, array('position'=>'S', 'border'=>true, 'padding'=>4, 'fgcolor'=>array(0,0,0), 'bgcolor'=>array(255,255,255), 'text'=>true, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>4), 'N'));
|
||||
$params = $pdf->serializeTCPDFtagParameters(['CODE 39', 'C39', '', '', 80, 30, 0.4, ['position'=>'S', 'border'=>true, 'padding'=>4, 'fgcolor'=>[0,0,0], 'bgcolor'=>[255,255,255], 'text'=>true, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>4], 'N']);
|
||||
$html .= '<tcpdf method="write1DBarcode" params="'.$params.'" />';
|
||||
|
||||
$params = $pdf->serializeTCPDFtagParameters(array('CODE 128', 'C128', '', '', 80, 30, 0.4, array('position'=>'S', 'border'=>true, 'padding'=>4, 'fgcolor'=>array(0,0,0), 'bgcolor'=>array(255,255,255), 'text'=>true, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>4), 'N'));
|
||||
$params = $pdf->serializeTCPDFtagParameters(['CODE 128', 'C128', '', '', 80, 30, 0.4, ['position'=>'S', 'border'=>true, 'padding'=>4, 'fgcolor'=>[0,0,0], 'bgcolor'=>[255,255,255], 'text'=>true, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>4], 'N']);
|
||||
$html .= '<tcpdf method="write1DBarcode" params="'.$params.'" />';
|
||||
|
||||
$html .= '<tcpdf method="AddPage" /><h2>Graphic Functions</h2>';
|
||||
|
||||
$params = $pdf->serializeTCPDFtagParameters(array(0));
|
||||
$params = $pdf->serializeTCPDFtagParameters([0]);
|
||||
$html .= '<tcpdf method="SetDrawColor" params="'.$params.'" />';
|
||||
|
||||
$params = $pdf->serializeTCPDFtagParameters(array(50, 50, 40, 10, 'DF', array(), array(0,128,255)));
|
||||
$params = $pdf->serializeTCPDFtagParameters([50, 50, 40, 10, 'DF', [], [0,128,255]]);
|
||||
$html .= '<tcpdf method="Rect" params="'.$params.'" />';
|
||||
|
||||
|
||||
// output the HTML content
|
||||
$pdf->writeHTML($html, true, 0, true, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_050.php
|
||||
// Begin : 2009-04-09
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 050', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -78,21 +78,20 @@ $pdf->AddPage();
|
|||
$txt = "You can also export 2D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcode directory.\n";
|
||||
$pdf->MultiCell(70, 50, $txt, 0, 'J', false, 1, 125, 30, true, 0, false, true, 0, 'T', false);
|
||||
|
||||
|
||||
$pdf->setFont('helvetica', '', 10);
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
// set style for barcode
|
||||
$style = array(
|
||||
$style = [
|
||||
'border' => true,
|
||||
'vpadding' => 'auto',
|
||||
'hpadding' => 'auto',
|
||||
'fgcolor' => array(0,0,0),
|
||||
'fgcolor' => [0,0,0],
|
||||
'bgcolor' => false, //array(255,255,255)
|
||||
'module_width' => 1, // width of a single module in points
|
||||
'module_height' => 1 // height of a single module in points
|
||||
);
|
||||
'module_height' => 1, // height of a single module in points
|
||||
];
|
||||
|
||||
// write RAW 2D Barcode
|
||||
|
||||
|
|
@ -106,15 +105,15 @@ $pdf->write2DBarcode($code, 'RAW2', 80, 60, 30, 20, $style, 'N');
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
// set style for barcode
|
||||
$style = array(
|
||||
$style = [
|
||||
'border' => 2,
|
||||
'vpadding' => 'auto',
|
||||
'hpadding' => 'auto',
|
||||
'fgcolor' => array(0,0,0),
|
||||
'fgcolor' => [0,0,0],
|
||||
'bgcolor' => false, //array(255,255,255)
|
||||
'module_width' => 1, // width of a single module in points
|
||||
'module_height' => 1 // height of a single module in points
|
||||
);
|
||||
'module_height' => 1, // height of a single module in points
|
||||
];
|
||||
|
||||
// QRCODE,L : QR-CODE Low error correction
|
||||
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,L', 20, 30, 50, 50, $style, 'N');
|
||||
|
|
@ -177,24 +176,24 @@ $pdf->Text(80, 145, 'DATAMATRIX (ISO/IEC 16022:2006)');
|
|||
// -------------------------------------------------------------------
|
||||
|
||||
// new style
|
||||
$style = array(
|
||||
$style = [
|
||||
'border' => 2,
|
||||
'padding' => 'auto',
|
||||
'fgcolor' => array(0,0,255),
|
||||
'bgcolor' => array(255,255,64)
|
||||
);
|
||||
'fgcolor' => [0,0,255],
|
||||
'bgcolor' => [255,255,64],
|
||||
];
|
||||
|
||||
// QRCODE,H : QR-CODE Best error correction
|
||||
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', 80, 210, 50, 50, $style, 'N');
|
||||
$pdf->Text(80, 205, 'QRCODE H - COLORED');
|
||||
|
||||
// new style
|
||||
$style = array(
|
||||
$style = [
|
||||
'border' => false,
|
||||
'padding' => 0,
|
||||
'fgcolor' => array(128,0,0),
|
||||
'bgcolor' => false
|
||||
);
|
||||
'fgcolor' => [128,0,0],
|
||||
'bgcolor' => false,
|
||||
];
|
||||
|
||||
// QRCODE,H : QR-CODE Best error correction
|
||||
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', 140, 210, 50, 50, $style, 'N');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_051.php
|
||||
// Begin : 2009-04-16
|
||||
|
|
@ -27,11 +27,10 @@
|
|||
// Include the main TCPDF library (search for installation path).
|
||||
require_once('tcpdf_include.php');
|
||||
|
||||
|
||||
// Extend the TCPDF class to create custom Header and Footer
|
||||
class MYPDF extends TCPDF {
|
||||
//Page header
|
||||
public function Header() {
|
||||
public function Header() : void {
|
||||
// get the current page break margin
|
||||
$bMargin = $this->getBreakMargin();
|
||||
// get current auto-page-break mode
|
||||
|
|
@ -59,7 +58,7 @@ $pdf->setSubject('TCPDF Tutorial');
|
|||
$pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
||||
|
||||
// set header and footer fonts
|
||||
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -73,14 +72,14 @@ $pdf->setFooterMargin(0);
|
|||
$pdf->setPrintFooter(false);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -97,7 +96,6 @@ $html = '<span style="background-color:yellow;color:blue;"> PAGE 1 </s
|
|||
<p stroke="0.2" fill="true" strokecolor="yellow" color="blue" style="font-family:helvetica;font-weight:bold;font-size:26pt;">You can set a full page background.</p>';
|
||||
$pdf->writeHTML($html, true, false, true, false, '');
|
||||
|
||||
|
||||
// add a page
|
||||
$pdf->AddPage();
|
||||
|
||||
|
|
@ -113,7 +111,6 @@ $pdf->setPrintHeader(false);
|
|||
// add a page
|
||||
$pdf->AddPage();
|
||||
|
||||
|
||||
// -- set new background ---
|
||||
|
||||
// get the current page break margin
|
||||
|
|
@ -130,7 +127,6 @@ $pdf->setAutoPageBreak($auto_page_break, $bMargin);
|
|||
// set the starting point for the page content
|
||||
$pdf->setPageMark();
|
||||
|
||||
|
||||
// Print a text
|
||||
$html = '<span style="color:white;text-align:center;font-weight:bold;font-size:80pt;">PAGE 3</span>';
|
||||
$pdf->writeHTML($html, true, false, true, false, '');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_052.php
|
||||
// Begin : 2009-05-07
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 052', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -77,12 +77,12 @@ NOTES:
|
|||
$certificate = 'file://data/cert/tcpdf.crt';
|
||||
|
||||
// set additional information
|
||||
$info = array(
|
||||
$info = [
|
||||
'Name' => 'TCPDF',
|
||||
'Location' => 'Office',
|
||||
'Reason' => 'Testing TCPDF',
|
||||
'ContactInfo' => 'http://www.tcpdf.org',
|
||||
);
|
||||
];
|
||||
|
||||
// set document signature
|
||||
$pdf->setSignature($certificate, $certificate, 'tcpdfdemo', '', 2, $info);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_053.php
|
||||
// Begin : 2009-09-02
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 053', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_054.php
|
||||
// Begin : 2009-09-07
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 054', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_055.php
|
||||
// Begin : 2009-10-21
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 055', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
|||
$pdf->setFont('helvetica', '', 14);
|
||||
|
||||
// array of font names
|
||||
$core_fonts = array('courier', 'courierB', 'courierI', 'courierBI', 'helvetica', 'helveticaB', 'helveticaI', 'helveticaBI', 'times', 'timesB', 'timesI', 'timesBI', 'symbol', 'zapfdingbats');
|
||||
$core_fonts = ['courier', 'courierB', 'courierI', 'courierBI', 'helvetica', 'helveticaB', 'helveticaI', 'helveticaBI', 'times', 'timesB', 'timesI', 'timesBI', 'symbol', 'zapfdingbats'];
|
||||
|
||||
// set fill color
|
||||
$pdf->setFillColor(221,238,255);
|
||||
|
|
@ -93,7 +93,7 @@ foreach($core_fonts as $font) {
|
|||
|
||||
// print each character
|
||||
for ($i = 0; $i < 256; ++$i) {
|
||||
if (($i > 0) AND (($i % 16) == 0)) {
|
||||
if (($i > 0) && (($i % 16) == 0)) {
|
||||
$pdf->Ln();
|
||||
}
|
||||
$pdf->Cell(11.25, 11.25, TCPDF_FONTS::unichr($i), 1, 0, 'C', false, '', 0, false, 'T', 'M');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_056.php
|
||||
// Begin : 2010-03-26
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 056', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -93,20 +93,20 @@ $pdf->cropMark(140, 120, 10, 10, 'BR');
|
|||
|
||||
// various crop marks
|
||||
|
||||
$pdf->cropMark(95, 65, 5, 5, 'LEFT,TOP,RIGHT', array(255,0,0));
|
||||
$pdf->cropMark(95, 125, 5, 5, 'LEFT,BOTTOM,RIGHT', array(255,0,0));
|
||||
$pdf->cropMark(95, 65, 5, 5, 'LEFT,TOP,RIGHT', [255,0,0]);
|
||||
$pdf->cropMark(95, 125, 5, 5, 'LEFT,BOTTOM,RIGHT', [255,0,0]);
|
||||
|
||||
$pdf->cropMark(45, 95, 5, 5, 'TL,BL', array(0,255,0));
|
||||
$pdf->cropMark(145, 95, 5, 5, 'TR,BR', array(0,255,0));
|
||||
$pdf->cropMark(45, 95, 5, 5, 'TL,BL', [0,255,0]);
|
||||
$pdf->cropMark(145, 95, 5, 5, 'TR,BR', [0,255,0]);
|
||||
|
||||
$pdf->cropMark(95, 140, 5, 5, 'A,D', array(0,0,255));
|
||||
$pdf->cropMark(95, 140, 5, 5, 'A,D', [0,0,255]);
|
||||
|
||||
// registration marks
|
||||
|
||||
$pdf->registrationMark(40, 60, 5, false);
|
||||
$pdf->registrationMark(150, 60, 5, true, array(0,0,0), array(255,255,0));
|
||||
$pdf->registrationMark(40, 130, 5, true, array(0,0,0), array(255,255,0));
|
||||
$pdf->registrationMark(150, 130, 5, false, array(100,100,100,100,'All'), array(0,0,0,0,'None'));
|
||||
$pdf->registrationMark(150, 60, 5, true, [0,0,0], [255,255,0]);
|
||||
$pdf->registrationMark(40, 130, 5, true, [0,0,0], [255,255,0]);
|
||||
$pdf->registrationMark(150, 130, 5, false, [100,100,100,100,'All'], [0,0,0,0,'None']);
|
||||
|
||||
// test registration bar with spot colors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_057.php
|
||||
// Begin : 2010-04-03
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 057', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,6 @@ $pdf->Cell(30, 0, 'Ascent-Center', 1, $ln=0, 'C', 0, '', 0, false, 'A', 'C');
|
|||
$pdf->Cell(30, 0, 'Baseline-Center', 1, $ln=0, 'C', 0, '', 0, false, 'L', 'C');
|
||||
$pdf->Cell(30, 0, 'Descent-Center', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'C');
|
||||
|
||||
|
||||
$pdf->setXY(15, 90);
|
||||
|
||||
// text on top
|
||||
|
|
@ -105,7 +104,6 @@ $pdf->Cell(30, 0, 'Ascent-Top', 1, $ln=0, 'C', 0, '', 0, false, 'A', 'T');
|
|||
$pdf->Cell(30, 0, 'Baseline-Top', 1, $ln=0, 'C', 0, '', 0, false, 'L', 'T');
|
||||
$pdf->Cell(30, 0, 'Descent-Top', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'T');
|
||||
|
||||
|
||||
$pdf->setXY(15, 120);
|
||||
|
||||
// text on bottom
|
||||
|
|
@ -116,9 +114,8 @@ $pdf->Cell(30, 0, 'Ascent-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'A', 'B');
|
|||
$pdf->Cell(30, 0, 'Baseline-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'L', 'B');
|
||||
$pdf->Cell(30, 0, 'Descent-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'B');
|
||||
|
||||
|
||||
// draw some reference lines
|
||||
$linestyle = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(255, 0, 0));
|
||||
$linestyle = ['width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => [255, 0, 0]];
|
||||
$pdf->Line(15, 60, 195, 60, $linestyle);
|
||||
$pdf->Line(15, 90, 195, 90, $linestyle);
|
||||
$pdf->Line(15, 120, 195, 120, $linestyle);
|
||||
|
|
@ -233,23 +230,23 @@ $pdf->setDrawColor(0,128,255);
|
|||
// set filling color
|
||||
$pdf->setFillColor(255,255,128);
|
||||
|
||||
$border = array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));
|
||||
$border = ['LTRB' => ['width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [255, 0, 0]]];
|
||||
$pdf->Cell(30, 0, 'LTRB', $border, 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||
$pdf->Ln(5);
|
||||
|
||||
$border = array(
|
||||
'L' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)),
|
||||
'R' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 255)),
|
||||
'T' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 255, 0)),
|
||||
'B' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 255)));
|
||||
$border = [
|
||||
'L' => ['width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => [255, 0, 0]],
|
||||
'R' => ['width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => [255, 0, 255]],
|
||||
'T' => ['width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => [0, 255, 0]],
|
||||
'B' => ['width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => [0, 0, 255]]];
|
||||
$pdf->Cell(30, 0, 'LTRB', $border, 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||
$pdf->Ln(5);
|
||||
|
||||
$border = array('mode' => 'ext', 'LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));
|
||||
$border = ['mode' => 'ext', 'LTRB' => ['width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [255, 0, 0]]];
|
||||
$pdf->Cell(30, 0, 'LTRB EXT', $border, 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||
$pdf->Ln(5);
|
||||
|
||||
$border = array('mode' => 'int', 'LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));
|
||||
$border = ['mode' => 'int', 'LTRB' => ['width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [255, 0, 0]]];
|
||||
$pdf->Cell(30, 0, 'LTRB INT', $border, 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||
$pdf->Ln(5);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_058.php
|
||||
// Begin : 2010-04-22
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 058', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_059.php
|
||||
// Begin : 2010-05-06
|
||||
|
|
@ -31,12 +31,11 @@ require_once('tcpdf_include.php');
|
|||
* TCPDF class extension with custom header and footer for TOC page
|
||||
*/
|
||||
class TOC_TCPDF extends TCPDF {
|
||||
|
||||
/**
|
||||
* Overwrite Header() method.
|
||||
* @public
|
||||
*/
|
||||
public function Header() {
|
||||
public function Header() : void {
|
||||
if ($this->tocpage) {
|
||||
// *** replace the following parent::Header() with your code for TOC page
|
||||
parent::Header();
|
||||
|
|
@ -50,7 +49,7 @@ class TOC_TCPDF extends TCPDF {
|
|||
* Overwrite Footer() method.
|
||||
* @public
|
||||
*/
|
||||
public function Footer() {
|
||||
public function Footer() : void {
|
||||
if ($this->tocpage) {
|
||||
// *** replace the following parent::Footer() with your code for TOC page
|
||||
parent::Footer();
|
||||
|
|
@ -59,7 +58,6 @@ class TOC_TCPDF extends TCPDF {
|
|||
parent::Footer();
|
||||
}
|
||||
}
|
||||
|
||||
} // end of class
|
||||
|
||||
// create new PDF document
|
||||
|
|
@ -76,8 +74,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 059', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -88,14 +86,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -110,38 +108,36 @@ $pdf->setFont('helvetica', '', 10);
|
|||
$pdf->AddPage();
|
||||
|
||||
// set a bookmark for the current position
|
||||
$pdf->Bookmark('Chapter 1', 0, 0, '', 'B', array(0,64,128));
|
||||
$pdf->Bookmark('Chapter 1', 0, 0, '', 'B', [0,64,128]);
|
||||
|
||||
// print a line using Cell()
|
||||
$pdf->Cell(0, 10, 'Chapter 1', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Paragraph 1.1', 1, 0, '', '', array(128,0,0));
|
||||
$pdf->Bookmark('Paragraph 1.1', 1, 0, '', '', [128,0,0]);
|
||||
$pdf->Cell(0, 10, 'Paragraph 1.1', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Paragraph 1.2', 1, 0, '', '', array(128,0,0));
|
||||
$pdf->Bookmark('Paragraph 1.2', 1, 0, '', '', [128,0,0]);
|
||||
$pdf->Cell(0, 10, 'Paragraph 1.2', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Sub-Paragraph 1.2.1', 2, 0, '', 'I', array(0,128,0));
|
||||
$pdf->Bookmark('Sub-Paragraph 1.2.1', 2, 0, '', 'I', [0,128,0]);
|
||||
$pdf->Cell(0, 10, 'Sub-Paragraph 1.2.1', 0, 1, 'L');
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Paragraph 1.3', 1, 0, '', '', array(128,0,0));
|
||||
$pdf->Bookmark('Paragraph 1.3', 1, 0, '', '', [128,0,0]);
|
||||
$pdf->Cell(0, 10, 'Paragraph 1.3', 0, 1, 'L');
|
||||
|
||||
// add some pages and bookmarks
|
||||
for ($i = 2; $i < 12; $i++) {
|
||||
for ($i = 2; $i < 12; ++$i) {
|
||||
$pdf->AddPage();
|
||||
$pdf->Bookmark('Chapter '.$i, 0, 0, '', 'B', array(0,64,128));
|
||||
$pdf->Bookmark('Chapter '.$i, 0, 0, '', 'B', [0,64,128]);
|
||||
$pdf->Cell(0, 10, 'Chapter '.$i, 0, 1, 'L');
|
||||
}
|
||||
|
||||
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
// add a new page for TOC
|
||||
$pdf->addTOCPage();
|
||||
|
||||
|
|
@ -152,7 +148,7 @@ $pdf->Ln();
|
|||
$pdf->setFont('helvetica', '', 10);
|
||||
|
||||
// define styles for various bookmark levels
|
||||
$bookmark_templates = array();
|
||||
$bookmark_templates = [];
|
||||
|
||||
/*
|
||||
* The key of the $bookmark_templates array represent the bookmark level (from 0 to n).
|
||||
|
|
@ -173,7 +169,7 @@ $bookmark_templates[2] = '<table border="0" cellpadding="0" cellspacing="0"><tr>
|
|||
|
||||
// add table of content at page 1
|
||||
// (check the example n. 45 for a text-only TOC
|
||||
$pdf->addHTMLTOC(1, 'INDEX', $bookmark_templates, true, 'B', array(128,0,0));
|
||||
$pdf->addHTMLTOC(1, 'INDEX', $bookmark_templates, true, 'B', [128,0,0]);
|
||||
|
||||
// end of TOC page
|
||||
$pdf->endTOCPage();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_060.php
|
||||
// Begin : 2010-05-17
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 060', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -70,22 +70,22 @@ $pdf->setFont('helvetica', '', 20);
|
|||
// ---------------------------------------------------------
|
||||
|
||||
// set page format (read source code documentation for further information)
|
||||
$page_format = array(
|
||||
'MediaBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 297),
|
||||
'CropBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 297),
|
||||
'BleedBox' => array ('llx' => 5, 'lly' => 5, 'urx' => 205, 'ury' => 292),
|
||||
'TrimBox' => array ('llx' => 10, 'lly' => 10, 'urx' => 200, 'ury' => 287),
|
||||
'ArtBox' => array ('llx' => 15, 'lly' => 15, 'urx' => 195, 'ury' => 282),
|
||||
$page_format = [
|
||||
'MediaBox' => ['llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 297],
|
||||
'CropBox' => ['llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 297],
|
||||
'BleedBox' => ['llx' => 5, 'lly' => 5, 'urx' => 205, 'ury' => 292],
|
||||
'TrimBox' => ['llx' => 10, 'lly' => 10, 'urx' => 200, 'ury' => 287],
|
||||
'ArtBox' => ['llx' => 15, 'lly' => 15, 'urx' => 195, 'ury' => 282],
|
||||
'Dur' => 3,
|
||||
'trans' => array(
|
||||
'trans' => [
|
||||
'D' => 1.5,
|
||||
'S' => 'Split',
|
||||
'Dm' => 'V',
|
||||
'M' => 'O'
|
||||
),
|
||||
'M' => 'O',
|
||||
],
|
||||
'Rotate' => 90,
|
||||
'PZ' => 1,
|
||||
);
|
||||
];
|
||||
|
||||
// Check the example n. 29 for viewer preferences
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_061.php
|
||||
// Begin : 2010-05-24
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 061', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_062.php
|
||||
// Begin : 2010-08-25
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 062', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -84,7 +84,6 @@ $pdf->Write(0, 'XObject Templates', '', 0, 'C', 1, 0, false, false, 0);
|
|||
* the time it is invoked.
|
||||
*/
|
||||
|
||||
|
||||
// start a new XObject Template and set transparency group option
|
||||
$template_id = $pdf->startTemplate(60, 60, true);
|
||||
|
||||
|
|
@ -115,7 +114,6 @@ $pdf->Cell(60, 60, 'Template', 0, 0, 'C', false, '', 0, false, 'T', 'M');
|
|||
// end the current Template
|
||||
$pdf->endTemplate();
|
||||
|
||||
|
||||
// print the selected Template various times using various transparencies
|
||||
|
||||
$pdf->setAlpha(0.4);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_063.php
|
||||
// Begin : 2010-09-29
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 063', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -77,9 +77,8 @@ $pdf->Ln(5);
|
|||
|
||||
// create several cells to display all cases of stretching and spacing combinations.
|
||||
|
||||
$fonts = array('times', 'dejavuserif');
|
||||
$alignments = array('L' => 'LEFT', 'C' => 'CENTER', 'R' => 'RIGHT', 'J' => 'JUSTIFY');
|
||||
|
||||
$fonts = ['times', 'dejavuserif'];
|
||||
$alignments = ['L' => 'LEFT', 'C' => 'CENTER', 'R' => 'RIGHT', 'J' => 'JUSTIFY'];
|
||||
|
||||
// Test all cases using direct stretching/spacing methods
|
||||
foreach ($fonts as $fkey => $font) {
|
||||
|
|
@ -89,7 +88,7 @@ foreach ($fonts as $fkey => $font) {
|
|||
for ($spacing = -0.254; $spacing <= 0.254; $spacing += 0.254) {
|
||||
$pdf->setFontStretching($stretching);
|
||||
$pdf->setFontSpacing($spacing);
|
||||
$txt = $align_name.' | Stretching = '.$stretching.'% | Spacing = '.sprintf('%+.3F', $spacing).'mm';
|
||||
$txt = $align_name.' | Stretching = '.$stretching.'% | Spacing = '.\sprintf('%+.3F', $spacing).'mm';
|
||||
$pdf->Cell(0, 0, $txt, 1, 1, $align_mode);
|
||||
}
|
||||
}
|
||||
|
|
@ -97,24 +96,22 @@ foreach ($fonts as $fkey => $font) {
|
|||
$pdf->AddPage();
|
||||
}
|
||||
|
||||
|
||||
// Test all cases using CSS stretching/spacing properties
|
||||
foreach ($fonts as $fkey => $font) {
|
||||
$pdf->setFont($font, '', 11);
|
||||
foreach ($alignments as $align_mode => $align_name) {
|
||||
for ($stretching = 90; $stretching <= 110; $stretching += 10) {
|
||||
for ($spacing = -0.254; $spacing <= 0.254; $spacing += 0.254) {
|
||||
$html = '<span style="font-stretch:'.$stretching.'%;letter-spacing:'.$spacing.'mm;"><span style="color:red;">'.$align_name.'</span> | <span style="color:green;">Stretching = '.$stretching.'%</span> | <span style="color:blue;">Spacing = '.sprintf('%+.3F', $spacing).'mm</span><br />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.</span>';
|
||||
$html = '<span style="font-stretch:'.$stretching.'%;letter-spacing:'.$spacing.'mm;"><span style="color:red;">'.$align_name.'</span> | <span style="color:green;">Stretching = '.$stretching.'%</span> | <span style="color:blue;">Spacing = '.\sprintf('%+.3F', $spacing).'mm</span><br />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.</span>';
|
||||
$pdf->writeHTMLCell(0, 0, '', '', $html, 1, 1, false, true, $align_mode, false);
|
||||
}
|
||||
}
|
||||
if (!(($fkey == 1) AND ($align_mode == 'J'))) {
|
||||
if (!(($fkey == 1) && ($align_mode == 'J'))) {
|
||||
$pdf->AddPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// reset font stretching
|
||||
$pdf->setFontStretching(100);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_064.php
|
||||
// Begin : 2010-10-13
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 064', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +69,6 @@ if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
|||
// set font
|
||||
$pdf->setFont('helvetica', '', 8);
|
||||
|
||||
|
||||
// define some html content for testing
|
||||
$txt = '<p style="text-align:justify;color:blue;font-size:12pt;"><span style="color:red;font-size:14pt;font-weight:bold;">TEST PAGE REGIONS:</span> <span style="color:green;">A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. A region is always aligned on the left or right side of the page ad is defined using a vertical segment. You can set multiple regions for the same page. You can combine several adjacent regions to approximate curved shapes.</span> 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.
|
||||
|
|
@ -77,7 +76,6 @@ Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet in
|
|||
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.</p>';
|
||||
|
||||
|
||||
// add a page
|
||||
$pdf->AddPage();
|
||||
|
||||
|
|
@ -86,39 +84,37 @@ $pdf->Image('images/image_demo.jpg', 155, 30, 40, 40, 'JPG', '', '', true);
|
|||
$pdf->Image('images/image_demo.jpg', 15, 230, 40, 40, 'JPG', '', '', true);
|
||||
|
||||
// define some graphic styles
|
||||
$styleA = array('width' => 0.254, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0));
|
||||
$styleB = array('width' => 0.254, 'cap' => 'butt', 'join' => 'miter', 'dash' => 3, 'color' => array(127, 127, 127));
|
||||
$styleA = ['width' => 0.254, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [255, 0, 0]];
|
||||
$styleB = ['width' => 0.254, 'cap' => 'butt', 'join' => 'miter', 'dash' => 3, 'color' => [127, 127, 127]];
|
||||
$pdf->setFillColor(220, 255, 220);
|
||||
|
||||
// write a trapezoid with some information about no-write page regions
|
||||
$pdf->Polygon(array(15,90, 57,90, 67,140, 15,140), 'DF', array($styleB, $styleA, $styleB, $styleB));
|
||||
$pdf->Polygon([15,90, 57,90, 67,140, 15,140], 'DF', [$styleB, $styleA, $styleB, $styleB]);
|
||||
$pdf->setXY(15, 90);
|
||||
$pdf->Cell(42, 0, 'xt,yt', 0, 0, 'R', false, '', 0, false, 'T', 'T');
|
||||
$pdf->setXY(15, 140);
|
||||
$pdf->Cell(52, 0, 'xb,yb', 0, 0, 'R', false, '', 0, false, 'B', 'B');
|
||||
$pdf->setXY(15, 115);
|
||||
$pdf->Cell(40, 0, 'side', 0, 0, 'R', false, '', 0, false, 'B', 'B');
|
||||
$pdf->setLineStyle(array('width' => 0.254, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
|
||||
$pdf->setLineStyle(['width' => 0.254, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [0, 0, 0]]);
|
||||
$pdf->Arrow(60, 115, 35, 115, 2, 5, 15);
|
||||
|
||||
// write a trapezoid with some information about no-write page regions
|
||||
$pdf->Polygon(array(145,130, 195,130, 195,180, 155,180), 'DF', array($styleB, $styleB, $styleB, $styleA));
|
||||
$pdf->Polygon([145,130, 195,130, 195,180, 155,180], 'DF', [$styleB, $styleB, $styleB, $styleA]);
|
||||
$pdf->setXY(145, 130);
|
||||
$pdf->Cell(42, 0, 'xt,yt', 0, 0, 'L', false, '', 0, false, 'T', 'T');
|
||||
$pdf->setXY(155, 180);
|
||||
$pdf->Cell(52, 0, 'xb,yb', 0, 0, 'L', false, '', 0, false, 'B', 'B');
|
||||
$pdf->setXY(160, 155);
|
||||
$pdf->Cell(30, 0, 'side', 0, 0, 'L', false, '', 0, false, 'B', 'B');
|
||||
$pdf->setLineStyle(array('width' => 0.254, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
|
||||
$pdf->setLineStyle(['width' => 0.254, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [0, 0, 0]]);
|
||||
$pdf->Arrow(155, 155, 180, 155, 2, 5, 15);
|
||||
|
||||
// reset x,y position
|
||||
$pdf->setXY(15, 30);
|
||||
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
// define no-write page regions to avoid text overlapping images
|
||||
/*
|
||||
'page' => page number or empy for current page
|
||||
|
|
@ -127,12 +123,12 @@ $pdf->setXY(15, 30);
|
|||
'yb' => Y bottom
|
||||
'side' => page side ('L' = left or 'R' = right)
|
||||
*/
|
||||
$regions = array(
|
||||
array('page' => '', 'xt' => 153, 'yt' => 30, 'xb' => 153, 'yb' => 70, 'side' => 'R'),
|
||||
array('page' => '', 'xt' => 60, 'yt' => 90, 'xb' => 70, 'yb' => 140, 'side' => 'L'),
|
||||
array('page' => '', 'xt' => 143, 'yt' => 130, 'xb' => 153, 'yb' => 180, 'side' => 'R'),
|
||||
array('page' => '', 'xt' => 58, 'yt' => 230, 'xb' => 58, 'yb' => 270, 'side' => 'L')
|
||||
);
|
||||
$regions = [
|
||||
['page' => '', 'xt' => 153, 'yt' => 30, 'xb' => 153, 'yb' => 70, 'side' => 'R'],
|
||||
['page' => '', 'xt' => 60, 'yt' => 90, 'xb' => 70, 'yb' => 140, 'side' => 'L'],
|
||||
['page' => '', 'xt' => 143, 'yt' => 130, 'xb' => 153, 'yb' => 180, 'side' => 'R'],
|
||||
['page' => '', 'xt' => 58, 'yt' => 230, 'xb' => 58, 'yb' => 270, 'side' => 'L'],
|
||||
];
|
||||
|
||||
// set page regions, check also getPageRegions(), addPageRegion() and removePageRegion()
|
||||
$pdf->setPageRegions($regions);
|
||||
|
|
@ -140,23 +136,22 @@ $pdf->setPageRegions($regions);
|
|||
// write html text
|
||||
$pdf->writeHTML($txt, true, false, true, false, '');
|
||||
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
// set a circular no-write region on the second page
|
||||
$regions = array(
|
||||
array('page' => 2, 'xt' => 195, 'yt' => 110, 'xb' => 179.693, 'yb' => 113.045, 'side' => 'R'),
|
||||
array('page' => 2, 'xt' => 179.693, 'yt' => 113.045, 'xb' => 166.716, 'yb' => 121.716, 'side' => 'R'),
|
||||
array('page' => 2, 'xt' => 166.716, 'yt' => 121.716, 'xb' => 158.045, 'yb' => 134.693, 'side' => 'R'),
|
||||
array('page' => 2, 'xt' => 158.045, 'yt' => 134.693, 'xb' => 155, 'yb' => 150, 'side' => 'R'),
|
||||
array('page' => 2, 'xt' => 155, 'yt' => 150, 'xb' => 158.045, 'yb' => 165.307, 'side' => 'R'),
|
||||
array('page' => 2, 'xt' => 158.045, 'yt' => 165.307, 'xb' => 166.716, 'yb' => 178.284, 'side' => 'R'),
|
||||
array('page' => 2, 'xt' => 166.716, 'yt' => 178.284, 'xb' => 179.693, 'yb' => 186.955, 'side' => 'R'),
|
||||
array('page' => 2, 'xt' => 179.693, 'yt' => 186.955, 'xb' => 195, 'yb' => 190, 'side' => 'R')
|
||||
);
|
||||
$regions = [
|
||||
['page' => 2, 'xt' => 195, 'yt' => 110, 'xb' => 179.693, 'yb' => 113.045, 'side' => 'R'],
|
||||
['page' => 2, 'xt' => 179.693, 'yt' => 113.045, 'xb' => 166.716, 'yb' => 121.716, 'side' => 'R'],
|
||||
['page' => 2, 'xt' => 166.716, 'yt' => 121.716, 'xb' => 158.045, 'yb' => 134.693, 'side' => 'R'],
|
||||
['page' => 2, 'xt' => 158.045, 'yt' => 134.693, 'xb' => 155, 'yb' => 150, 'side' => 'R'],
|
||||
['page' => 2, 'xt' => 155, 'yt' => 150, 'xb' => 158.045, 'yb' => 165.307, 'side' => 'R'],
|
||||
['page' => 2, 'xt' => 158.045, 'yt' => 165.307, 'xb' => 166.716, 'yb' => 178.284, 'side' => 'R'],
|
||||
['page' => 2, 'xt' => 166.716, 'yt' => 178.284, 'xb' => 179.693, 'yb' => 186.955, 'side' => 'R'],
|
||||
['page' => 2, 'xt' => 179.693, 'yt' => 186.955, 'xb' => 195, 'yb' => 190, 'side' => 'R'],
|
||||
];
|
||||
$pdf->setPageRegions($regions);
|
||||
|
||||
$pdf->Polygon(array(195,110, 179.693,113.045, 166.716,121.716, 158.045,134.693, 155,150, 158.045,165.307, 166.716,178.284, 179.693,186.955, 195,190), 'DF');
|
||||
$pdf->Polygon([195,110, 179.693,113.045, 166.716,121.716, 158.045,134.693, 155,150, 158.045,165.307, 166.716,178.284, 179.693,186.955, 195,190], 'DF');
|
||||
|
||||
$pdf->Ln(15);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : example_065.php
|
||||
// Begin : 2011-09-28
|
||||
|
|
@ -41,8 +41,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 065', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -53,14 +53,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER);
|
|||
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
$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');
|
||||
if (@\file_exists(\dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(\dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Example 066 for TCPDF library
|
||||
|
|
@ -33,8 +33,8 @@ $pdf->setKeywords('TCPDF, PDF, example, test, guide');
|
|||
$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 066', 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));
|
||||
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
|
||||
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
|
@ -51,7 +51,7 @@ $pdf->setAutoPageBreak(true, PDF_MARGIN_BOTTOM);
|
|||
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||
|
||||
// set some language-dependent strings (optional)
|
||||
if (@file_exists(__DIR__ . '/lang/eng.php')) {
|
||||
if (@\file_exists(__DIR__ . '/lang/eng.php')) {
|
||||
require_once __DIR__ . '/lang/eng.php';
|
||||
|
||||
$pdf->setLanguageArray($l);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
echo '<'.'?'.'xml version="1.0" encoding="UTF-8"'.'?'.'>';
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : afr.php
|
||||
// Begin : 2010-10-26
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Afrikaans
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : ara.php
|
||||
// Begin : 2010-10-26
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Arabic
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : aze.php
|
||||
// Begin : 2010-10-26
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Azerbaijani
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : bel.php
|
||||
// Begin : 2010-10-26
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Basque
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : eng.php
|
||||
// Begin : 2004-03-03
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Brazilian
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : bul.php
|
||||
// Begin : 2004-03-03
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Bulgarian
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : cat.php
|
||||
// Begin : 2010-10-26
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Catalan
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : ces.php
|
||||
// Begin : 2010-10-26
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Czech
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : chi.php
|
||||
// Begin : 2010-10-26
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Chinese (Simplified)
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : urd.php
|
||||
// Begin : 2004-03-03
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Welsh
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : dan.php
|
||||
// Begin : 2010-10-26
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Danish
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : eng.php
|
||||
// Begin : 2004-03-03
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// English
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
//============================================================+
|
||||
// File name : est.php
|
||||
// Begin : 2010-10-26
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
// Estonian
|
||||
|
||||
global $l;
|
||||
$l = Array();
|
||||
$l = [];
|
||||
|
||||
// PAGE META DESCRIPTORS --------------------------------------
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user