diff --git a/composer.json b/composer.json
index 0b574dbc6..707ad5051 100644
--- a/composer.json
+++ b/composer.json
@@ -10,7 +10,7 @@
"ext-json": "*",
"ext-mysqli": "*",
"ext-soap": "*",
- "combodo/tcpdf": "6.3.5",
+ "combodo/tcpdf": "~6.4.4",
"nikic/php-parser": "^3.1",
"pear/archive_tar": "1.4.14",
"pelago/emogrifier": "2.1.0",
diff --git a/composer.lock b/composer.lock
index c4b3cf6ba..f6e6277e3 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "5141c3dfb5b8f6fdd5b262270fec9776",
+ "content-hash": "8efc1677968f1aeda2977543982242e6",
"packages": [
{
"name": "combodo/tcpdf",
- "version": "6.3.5",
+ "version": "6.4.4",
"source": {
"type": "git",
"url": "https://github.com/combodo-itop-libs/TCPDF.git",
- "reference": "aedd4b7b8cf7fcc24e617c405c9d3304150f4b94"
+ "reference": "0e31c013ccd000aa6762e9186778aa6e259ac8e8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/combodo-itop-libs/TCPDF/zipball/aedd4b7b8cf7fcc24e617c405c9d3304150f4b94",
- "reference": "aedd4b7b8cf7fcc24e617c405c9d3304150f4b94",
+ "url": "https://api.github.com/repos/combodo-itop-libs/TCPDF/zipball/0e31c013ccd000aa6762e9186778aa6e259ac8e8",
+ "reference": "0e31c013ccd000aa6762e9186778aa6e259ac8e8",
"shasum": ""
},
"require": {
@@ -62,9 +62,27 @@
"email": "contact@combodo.com"
}
],
- "description": "TCPDF fork adding requirements for iTop: Specific fonts.",
+ "description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"homepage": "https://github.com/combodo-itop-libs/TCPDF",
- "time": "2020-09-28T12:19:09+00:00"
+ "keywords": [
+ "PDFD32000-2008",
+ "TCPDF",
+ "barcodes",
+ "datamatrix",
+ "pdf",
+ "pdf417",
+ "qrcode"
+ ],
+ "support": {
+ "source": "https://github.com/combodo-itop-libs/TCPDF/tree/6.4.4"
+ },
+ "funding": [
+ {
+ "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_donations¤cy_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20tcpdf%20project",
+ "type": "custom"
+ }
+ ],
+ "time": "2022-03-10T14:36:39+00:00"
},
{
"name": "nikic/php-parser",
@@ -115,6 +133,10 @@
"parser",
"php"
],
+ "support": {
+ "issues": "https://github.com/nikic/PHP-Parser/issues",
+ "source": "https://github.com/nikic/PHP-Parser/tree/v3.1.5"
+ },
"time": "2018-02-28T20:30:58+00:00"
},
{
diff --git a/lib/combodo/tcpdf/.github/FUNDING.yml b/lib/combodo/tcpdf/.github/FUNDING.yml
deleted file mode 100644
index ca5b4292e..000000000
--- a/lib/combodo/tcpdf/.github/FUNDING.yml
+++ /dev/null
@@ -1 +0,0 @@
-custom: ['https://www.paypal.com/cgi-bin/webscr?cmd=_donations¤cy_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20tcpdf%20project']
diff --git a/lib/combodo/tcpdf/.gitignore b/lib/combodo/tcpdf/.gitignore
deleted file mode 100644
index 723ef36f4..000000000
--- a/lib/combodo/tcpdf/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-.idea
\ No newline at end of file
diff --git a/lib/combodo/tcpdf/CHANGELOG.TXT b/lib/combodo/tcpdf/CHANGELOG.TXT
index 3bdae3e24..e90bd161a 100644
--- a/lib/combodo/tcpdf/CHANGELOG.TXT
+++ b/lib/combodo/tcpdf/CHANGELOG.TXT
@@ -1,16 +1,129 @@
-6.2.25
+6.4.4 (2021-12-31)
+ - PHP 8.1 fixes
+
+6.4.3 (2021-12-28)
+ - Fix MultiCell PHPDoc typehint (#407)
+ - Fix type hint for \TCPDF_STATIC::_freadint (#414)
+ - Footer and Header font phpdoc fixes + constructor $pdfa phpdoc fix + setHeaderData lw param fix (#402)
+ - Fix text-annotation state options (#412)
+ - Fix - Named links have been broken. This fixes. (#415)
+ - Fixed type in comment for $lw header image logo width in mm
+ - Change Set to set. Fixes #419 (#421)
+ - Fix failing tests and failing tests not marking exit code as 1 (#426)
+ - Fix phpdoc and prefer null as default value (#444)
+ - Run on PHP 8.1 normally and add nightly PHP as allowed to fail (#452)
+ - Fix AES128 encryption if the OpenSSL extension is installed (#453)
+ - Explicitly cast values to int for imagesetpixel (#460)
+ - Fix cell_height_ratio type (#405)
+ - Leave   lowercase when using text-transform (#403)
+
+6.4.2 (2021-07-20)
+ - Fix PHP 8.1 type error with TCPDF_STATIC::pregSplit on preg_split
+ - Fix a PHP array offset error
+ - Fixed phpdoc blocks
+ - Drop a PHP 4 polyfill and add a .gitattributes file
+ - Added a test-suite
+ - Removed pointless assignments
+ - Fix docblock spelling error
+ - Update version info
+ - Fix color being filled to type 0 with PHP 8
+ - Fix warnings for undefined tags for $lineStyle
+ - Normalized composer.json
+ - Allowed transparency in PDF/A-2 and PDF/A-3
+ - Add a TCPDF composer example
+ - Fixed implicit conversion from float to int for PHP 8.1
+ - Removed status.txt from font directories, because of filesize
+ - Fixed type hints
+ - Removed "U" modifier from regexes
+
+6.4.1 (2021-03-27)
+ - Update tcpdf version (no code changes)
+
+6.4.0 (2021-03-27)
+ - allow styles on
tags
+ - check if file exists before calling unlink
+ - Fix image file type for urls with query params
+ - Fix SVGPath should accept 1.19.30 (equiv 1.19,.30) compacted values list
+ - Fix Second parameter of TCPDF::cell() must be a number
+ - PHP 8.0 function signature fixes
+ - Fix vulnerability to roman numeral bombs
+ - Optimized a regular expression
+ - Cache file get contents calls
+ - Remove mb_internal encoding handling
+
+6.3.5 (2020-02-14)
+ - Fixed curly braces in pdf417
+ - Fixed a syntax error issue when accessing an index of a casted variable
+
+6.3.4 (2020-02-12)
+ - Check if imagekeys exist
+ - Unlink only images in cache
+
+6.3.3 (2020-02-12)
+ - Fixed PHP 7.4 - cannot use array offset on integers
+ - Fixed PDF/A-3B validation issue caused by missing pdfaSchema:property.
+ - Removed backup changelog files from repo
+ - Prevents the deletion of non-existent files in /tmp
+ - Prevent crash in case of no list access in cache path
+ - Check existence of file before delete it
+ - Fixed erase users pictures
+ - Fixed problem with $imagekeys undefined or unlinked
+ - Fix SVGPath elliptical arc with rx/ry=0 + z should return to initial point
+ - Fixed PHP 7.4 errors
+ - handle integers for pages
+ - Fixed background image doesn't work in RTL
+ - Fixed PDF/A validity
+ - Fixed datamatrix.php for PHP 7.4
+ - Fixed deprecated PHP features
+
+6.3.2 (2019-09-20)
+ - Update ICC profile
+
+6.3.1 (2019-09-20)
+ - Fix reported version
+ - Fix Undefined property: GLPIPDF::$imagekeys
+
+6.3.0 (2019-09-19)
+ - fix SpotColor handling in HTML
+ - Add an additional empty test to prevent error in PHP 7.2
+ - Fix the documentation how to calculate the cell height
+ - Drop duplicated array indices
+ - Fix TCPDF_STATIC::fileGetContents()
+ - Introduce other version of pdfA (2 and 3)
+ - Add UF and AFRelationship missing
+ - Fix performance issue of cloned instances
+ - Change glob to readdir which performs better
+ - URI in PDF can result in E_NOTICE
+ - Fix a warning for PHP 7.4
+ - Fixed gradient offsets for percentage-based stops.
+ - Fixed file_get_contents return value should also be checked for a non-empty string
+ - Fix Array and string offset access syntax with curly braces is deprecated
+ - Fix PHP Warning: chr() expects parameter 1 to be int
+ - Add a VERSION file
+
+6.2.26 (2018-10-16)
+ - Update sRGB.icc with the one from the Debian package icc-profiles-free
+ - Fix unsupported operand types error when codepoints arrays are merged
+
+6.2.25 (2018-09-23)
- Fix support for image URLs.
6.2.24
- Support remote urls when checking if file exists.
-6.2.23
+6.2.23 (2018-09-22)
- Simplify file_exists function.
-6.2.22
+6.2.22 (2018-09-14)
+ - Fixes on `include/tcpdf_images.php`, `include/tcpdf_static.php` and `tcpdf.php` about file handling
+
+6.2.21 (2018-09-14)
+ - _no code changes_
+
+6.2.20 (2018-09-14)
- Fix for security vulnerability: Using the phar:// wrapper it was possible to trigger the unserialization of user provided data.
-6.2.19
+6.2.19 (2018-09-14)
- Merge various fixes for PHP 7.3 compatibility and security.
6.2.13 (2016-06-10)
diff --git a/lib/combodo/tcpdf/README.md b/lib/combodo/tcpdf/README.md
index db0149f69..0fb94009b 100644
--- a/lib/combodo/tcpdf/README.md
+++ b/lib/combodo/tcpdf/README.md
@@ -6,7 +6,7 @@
* **category** Library
* **author** Nicola Asuni
-* **copyright** 2002-2020 Nicola Asuni - Tecnick.com LTD
+* **copyright** 2002-2021 Nicola Asuni - Tecnick.com LTD
* **license** http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
* **link** http://www.tcpdf.org
* **source** https://github.com/tecnickcom/TCPDF
diff --git a/lib/combodo/tcpdf/VERSION b/lib/combodo/tcpdf/VERSION
index b98d1d3fa..49df80bfe 100644
--- a/lib/combodo/tcpdf/VERSION
+++ b/lib/combodo/tcpdf/VERSION
@@ -1 +1 @@
-6.3.5
+6.4.4
diff --git a/lib/combodo/tcpdf/composer.json b/lib/combodo/tcpdf/composer.json
index fe90ae9eb..b53dd6e7f 100644
--- a/lib/combodo/tcpdf/composer.json
+++ b/lib/combodo/tcpdf/composer.json
@@ -3,9 +3,19 @@
"replace": {
"tecnickcom/tcpdf": "self.version"
},
- "homepage": "https://github.com/combodo-itop-libs/TCPDF",
"type": "library",
- "description": "TCPDF fork adding requirements for iTop: Specific fonts.",
+ "description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
+ "keywords": [
+ "PDF",
+ "tcpdf",
+ "PDFD32000-2008",
+ "qrcode",
+ "datamatrix",
+ "pdf417",
+ "barcodes"
+ ],
+ "homepage": "https://github.com/combodo-itop-libs/TCPDF",
+ "version": "6.4.4",
"license": "LGPL-3.0-only",
"authors": [
{
diff --git a/lib/combodo/tcpdf/include/barcodes/datamatrix.php b/lib/combodo/tcpdf/include/barcodes/datamatrix.php
index 783f99da4..38bd625f7 100644
--- a/lib/combodo/tcpdf/include/barcodes/datamatrix.php
+++ b/lib/combodo/tcpdf/include/barcodes/datamatrix.php
@@ -229,7 +229,7 @@ class Datamatrix {
/**
* This is the class constructor.
* Creates a datamatrix object
- * @param $code (string) Code to represent using Datamatrix.
+ * @param string $code Code to represent using Datamatrix.
* @public
*/
public function __construct($code) {
@@ -355,11 +355,11 @@ class Datamatrix {
/**
* Product of two numbers in a Power-of-Two Galois Field
- * @param $a (int) first number to multiply.
- * @param $b (int) second number to multiply.
- * @param $log (array) Log table.
- * @param $alog (array) Anti-Log table.
- * @param $gf (array) Number of Factors of the Reed-Solomon polynomial.
+ * @param int $a first number to multiply.
+ * @param int $b second number to multiply.
+ * @param array $log Log table.
+ * @param array $alog Anti-Log table.
+ * @param int $gf Number of Factors of the Reed-Solomon polynomial.
* @return int product
* @protected
*/
@@ -372,12 +372,12 @@ class Datamatrix {
/**
* Add error correction codewords to data codewords array (ANNEX E).
- * @param $wd (array) Array of datacodewords.
- * @param $nb (int) Number of blocks.
- * @param $nd (int) Number of data codewords per block.
- * @param $nc (int) Number of correction codewords per block.
- * @param $gf (int) numner of fields on log/antilog table (power of 2).
- * @param $pp (int) The value of its prime modulus polynomial (301 for ECC200).
+ * @param array $wd Array of datacodewords.
+ * @param int $nb Number of blocks.
+ * @param int $nd Number of data codewords per block.
+ * @param int $nc Number of correction codewords per block.
+ * @param int $gf numner of fields on log/antilog table (power of 2).
+ * @param int $pp The value of its prime modulus polynomial (301 for ECC200).
* @return array data codewords + error codewords
* @protected
*/
@@ -438,9 +438,9 @@ class Datamatrix {
/**
* Return the 253-state codeword
- * @param $cwpad (int) Pad codeword.
- * @param $cwpos (int) Number of data codewords from the beginning of encoded data.
- * @return pad codeword
+ * @param int $cwpad Pad codeword.
+ * @param int $cwpos Number of data codewords from the beginning of encoded data.
+ * @return int pad codeword
* @protected
*/
protected function get253StateCodeword($cwpad, $cwpos) {
@@ -453,9 +453,9 @@ class Datamatrix {
/**
* Return the 255-state codeword
- * @param $cwpad (int) Pad codeword.
- * @param $cwpos (int) Number of data codewords from the beginning of encoded data.
- * @return pad codeword
+ * @param int $cwpad Pad codeword.
+ * @param int $cwpos Number of data codewords from the beginning of encoded data.
+ * @return int pad codeword
* @protected
*/
protected function get255StateCodeword($cwpad, $cwpos) {
@@ -468,8 +468,8 @@ class Datamatrix {
/**
* Returns true if the char belongs to the selected mode
- * @param $chr (int) Character (byte) to check.
- * @param $mode (int) Current encoding mode.
+ * @param int $chr Character (byte) to check.
+ * @param int $mode Current encoding mode.
* @return boolean true if the char is of the selected mode.
* @protected
*/
@@ -514,9 +514,9 @@ class Datamatrix {
/**
* The look-ahead test scans the data to be encoded to find the best mode (Annex P - steps from J to S).
- * @param $data (string) data to encode
- * @param $pos (int) current position
- * @param $mode (int) current encoding mode
+ * @param string $data data to encode
+ * @param int $pos current position
+ * @param int $mode current encoding mode
* @return int encoding mode
* @protected
*/
@@ -646,8 +646,8 @@ class Datamatrix {
/**
* Get the switching codeword to a new encoding mode (latch codeword)
- * @param $mode (int) New encoding mode.
- * @return (int) Switch codeword.
+ * @param int $mode New encoding mode.
+ * @return int Switch codeword.
* @protected
*/
protected function getSwitchEncodingCodeword($mode) {
@@ -685,8 +685,8 @@ class Datamatrix {
/**
* Choose the minimum matrix size and return the max number of data codewords.
- * @param $numcw (int) Number of current codewords.
- * @return number of data codewords in matrix
+ * @param int $numcw Number of current codewords.
+ * @return int number of data codewords in matrix
* @protected
*/
protected function getMaxDataCodewords($numcw) {
@@ -700,7 +700,7 @@ class Datamatrix {
/**
* Get high level encoding using the minimum symbol data characters for ECC 200
- * @param $data (string) data to encode
+ * @param string $data data to encode
* @return array of codewords
* @protected
*/
@@ -970,13 +970,13 @@ class Datamatrix {
/**
* Places "chr+bit" with appropriate wrapping within array[].
* (Annex F - ECC 200 symbol character placement)
- * @param $marr (array) Array of symbols.
- * @param $nrow (int) Number of rows.
- * @param $ncol (int) Number of columns.
- * @param $row (int) Row number.
- * @param $col (int) Column number.
- * @param $chr (int) Char byte.
- * @param $bit (int) Bit.
+ * @param array $marr Array of symbols.
+ * @param int $nrow Number of rows.
+ * @param int $ncol Number of columns.
+ * @param int $row Row number.
+ * @param int $col Column number.
+ * @param int $chr Char byte.
+ * @param int $bit Bit.
* @return array
* @protected
*/
@@ -996,12 +996,12 @@ class Datamatrix {
/**
* Places the 8 bits of a utah-shaped symbol character.
* (Annex F - ECC 200 symbol character placement)
- * @param $marr (array) Array of symbols.
- * @param $nrow (int) Number of rows.
- * @param $ncol (int) Number of columns.
- * @param $row (int) Row number.
- * @param $col (int) Column number.
- * @param $chr (int) Char byte.
+ * @param array $marr Array of symbols.
+ * @param int $nrow Number of rows.
+ * @param int $ncol Number of columns.
+ * @param int $row Row number.
+ * @param int $col Column number.
+ * @param int $chr Char byte.
* @return array
* @protected
*/
@@ -1020,10 +1020,10 @@ class Datamatrix {
/**
* Places the 8 bits of the first special corner case.
* (Annex F - ECC 200 symbol character placement)
- * @param $marr (array) Array of symbols.
- * @param $nrow (int) Number of rows.
- * @param $ncol (int) Number of columns.
- * @param $chr (int) Char byte.
+ * @param array $marr Array of symbols.
+ * @param int $nrow Number of rows.
+ * @param int $ncol Number of columns.
+ * @param int $chr Char byte.
* @return array
* @protected
*/
@@ -1042,10 +1042,10 @@ class Datamatrix {
/**
* Places the 8 bits of the second special corner case.
* (Annex F - ECC 200 symbol character placement)
- * @param $marr (array) Array of symbols.
- * @param $nrow (int) Number of rows.
- * @param $ncol (int) Number of columns.
- * @param $chr (int) Char byte.
+ * @param array $marr Array of symbols.
+ * @param int $nrow Number of rows.
+ * @param int $ncol Number of columns.
+ * @param int $chr Char byte.
* @return array
* @protected
*/
@@ -1064,10 +1064,10 @@ class Datamatrix {
/**
* Places the 8 bits of the third special corner case.
* (Annex F - ECC 200 symbol character placement)
- * @param $marr (array) Array of symbols.
- * @param $nrow (int) Number of rows.
- * @param $ncol (int) Number of columns.
- * @param $chr (int) Char byte.
+ * @param array $marr Array of symbols.
+ * @param int $nrow Number of rows.
+ * @param int $ncol Number of columns.
+ * @param int $chr Char byte.
* @return array
* @protected
*/
@@ -1086,10 +1086,10 @@ class Datamatrix {
/**
* Places the 8 bits of the fourth special corner case.
* (Annex F - ECC 200 symbol character placement)
- * @param $marr (array) Array of symbols.
- * @param $nrow (int) Number of rows.
- * @param $ncol (int) Number of columns.
- * @param $chr (int) Char byte.
+ * @param array $marr Array of symbols.
+ * @param int $nrow Number of rows.
+ * @param int $ncol Number of columns.
+ * @param int $chr Char byte.
* @return array
* @protected
*/
@@ -1108,8 +1108,8 @@ class Datamatrix {
/**
* Build a placement map.
* (Annex F - ECC 200 symbol character placement)
- * @param $nrow (int) Number of rows.
- * @param $ncol (int) Number of columns.
+ * @param int $nrow Number of rows.
+ * @param int $ncol Number of columns.
* @return array
* @protected
*/
diff --git a/lib/combodo/tcpdf/include/barcodes/pdf417.php b/lib/combodo/tcpdf/include/barcodes/pdf417.php
index 9a58a21f6..742802e1f 100644
--- a/lib/combodo/tcpdf/include/barcodes/pdf417.php
+++ b/lib/combodo/tcpdf/include/barcodes/pdf417.php
@@ -523,10 +523,10 @@ class PDF417 {
/**
* This is the class constructor.
* Creates a PDF417 object
- * @param $code (string) code to represent using PDF417
- * @param $ecl (int) error correction level (0-8); default -1 = automatic correction level
- * @param $aspectratio (float) the width to height of the symbol (excluding quiet zones)
- * @param $macro (array) information for macro block
+ * @param string $code code to represent using PDF417
+ * @param int $ecl error correction level (0-8); default -1 = automatic correction level
+ * @param float $aspectratio the width to height of the symbol (excluding quiet zones)
+ * @param array $macro information for macro block
* @public
*/
public function __construct($code, $ecl=-1, $aspectratio=2, $macro=array()) {
@@ -734,12 +734,13 @@ class PDF417 {
/**
* Returns the error correction level (0-8) to be used
- * @param $ecl (int) error correction level
- * @param $numcw (int) number of data codewords
+ * @param int $ecl error correction level
+ * @param int $numcw number of data codewords
* @return int error correction level
* @protected
*/
protected function getErrorCorrectionLevel($ecl, $numcw) {
+ $maxecl = 8; // starting error level
// check for automatic levels
if (($ecl < 0) OR ($ecl > 8)) {
if ($numcw < 41) {
@@ -755,7 +756,6 @@ class PDF417 {
}
}
// get maximum correction level
- $maxecl = 8; // starting error level
$maxerrsize = (928 - $numcw); // available codewords for error
while ($maxecl > 0) {
$errsize = (2 << $ecl);
@@ -772,8 +772,8 @@ class PDF417 {
/**
* Returns the error correction codewords
- * @param $cw (array) array of codewords including Symbol Length Descriptor and pad
- * @param $ecl (int) error correction level 0-8
+ * @param array $cw array of codewords including Symbol Length Descriptor and pad
+ * @param int $ecl error correction level 0-8
* @return array of error correction codewords
* @protected
*/
@@ -809,8 +809,8 @@ class PDF417 {
/**
* Create array of sequences from input
- * @param $code (string) code
- * @return bidimensional array containing characters and classification
+ * @param string $code code
+ * @return array bi-dimensional array containing characters and classification
* @protected
*/
protected function getInputSequences($code) {
@@ -864,9 +864,9 @@ class PDF417 {
/**
* Compact data by mode.
- * @param $mode (int) compaction mode number
- * @param $code (string) data to compact
- * @param $addmode (boolean) if true add the mode codeword at first position
+ * @param int $mode compaction mode number
+ * @param string $code data to compact
+ * @param boolean $addmode if true add the mode codeword at first position
* @return array of codewords
* @protected
*/
diff --git a/lib/combodo/tcpdf/include/barcodes/qrcode.php b/lib/combodo/tcpdf/include/barcodes/qrcode.php
index 7ef2759fd..2e7f2f576 100644
--- a/lib/combodo/tcpdf/include/barcodes/qrcode.php
+++ b/lib/combodo/tcpdf/include/barcodes/qrcode.php
@@ -247,32 +247,6 @@ if (!defined('QRCODEDEFS')) {
} // end of definitions
-// #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
-
-// for compatibility with PHP4
-if (!function_exists('str_split')) {
- /**
- * Convert a string to an array (needed for PHP4 compatibility)
- * @param $string (string) The input string.
- * @param $split_length (int) Maximum length of the chunk.
- * @return If the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string , the entire string is returned as the first (and only) array element.
- */
- function str_split($string, $split_length=1) {
- if ((strlen($string) > $split_length) OR (!$split_length)) {
- do {
- $c = strlen($string);
- $parts[] = substr($string, 0, $split_length);
- $string = substr($string, $split_length);
- } while ($string !== false);
- } else {
- $parts = array($string);
- }
- return $parts;
- }
-}
-
-// #####################################################
-
/**
* @class QRcode
* Class to create QR-code arrays for TCPDF class.
@@ -631,8 +605,8 @@ class QRcode {
/**
* This is the class constructor.
* Creates a QRcode object
- * @param $code (string) code to represent using QRcode
- * @param $eclevel (string) error level:
L : About 7% or less errors can be corrected.
M : About 15% or less errors can be corrected.
Q : About 25% or less errors can be corrected.
H : About 30% or less errors can be corrected.
+ * @param string $code code to represent using QRcode
+ * @param string $eclevel error level:
L : About 7% or less errors can be corrected.
M : About 15% or less errors can be corrected.
Q : About 25% or less errors can be corrected.
H : About 30% or less errors can be corrected.
* @public
* @since 1.0.000
*/
@@ -683,7 +657,7 @@ class QRcode {
/**
* Convert the frame in binary form
- * @param $frame (array) array to binarize
+ * @param array $frame array to binarize
* @return array frame in binary form
*/
protected function binarize($frame) {
@@ -699,7 +673,7 @@ class QRcode {
/**
* Encode the input string to QR code
- * @param $string (string) input string to encode
+ * @param string $string input string to encode
*/
protected function encodeString($string) {
$this->dataStr = $string;
@@ -715,7 +689,7 @@ class QRcode {
/**
* Encode mask
- * @param $mask (int) masking mode
+ * @param int $mask masking mode
*/
protected function encodeMask($mask) {
$spec = array(0, 0, 0, 0, 0);
@@ -780,8 +754,8 @@ class QRcode {
/**
* Set frame value at specified position
- * @param $at (array) x,y position
- * @param $val (int) value of the character to set
+ * @param array $at x,y position
+ * @param int $val value of the character to set
*/
protected function setFrameAt($at, $val) {
$this->frame[$at['y']][$at['x']] = chr($val);
@@ -789,7 +763,7 @@ class QRcode {
/**
* Get frame value at specified position
- * @param $at (array) x,y position
+ * @param array $at x,y position
* @return value at specified position
*/
protected function getFrameAt($at) {
@@ -853,8 +827,8 @@ class QRcode {
/**
* Initialize code.
- * @param $spec (array) array of ECC specification
- * @return 0 in case of success, -1 in case of error
+ * @param array $spec array of ECC specification
+ * @return int 0 in case of success, -1 in case of error
*/
protected function init($spec) {
$dl = $this->rsDataCodes1($spec);
@@ -932,10 +906,10 @@ class QRcode {
/**
* Write Format Information on frame and returns the number of black bits
- * @param $width (int) frame width
- * @param $frame (array) frame
- * @param $mask (array) masking mode
- * @param $level (int) error correction level
+ * @param int $width frame width
+ * @param array $frame frame
+ * @param array $mask masking mode
+ * @param int $level error correction level
* @return int blacks
*/
protected function writeFormatInformation($width, &$frame, $mask, $level) {
@@ -976,8 +950,8 @@ class QRcode {
/**
* mask0
- * @param $x (int) X position
- * @param $y (int) Y position
+ * @param int $x X position
+ * @param int $y Y position
* @return int mask
*/
protected function mask0($x, $y) {
@@ -986,8 +960,8 @@ class QRcode {
/**
* mask1
- * @param $x (int) X position
- * @param $y (int) Y position
+ * @param int $x X position
+ * @param int $y Y position
* @return int mask
*/
protected function mask1($x, $y) {
@@ -996,8 +970,8 @@ class QRcode {
/**
* mask2
- * @param $x (int) X position
- * @param $y (int) Y position
+ * @param int $x X position
+ * @param int $y Y position
* @return int mask
*/
protected function mask2($x, $y) {
@@ -1006,8 +980,8 @@ class QRcode {
/**
* mask3
- * @param $x (int) X position
- * @param $y (int) Y position
+ * @param int $x X position
+ * @param int $y Y position
* @return int mask
*/
protected function mask3($x, $y) {
@@ -1016,8 +990,8 @@ class QRcode {
/**
* mask4
- * @param $x (int) X position
- * @param $y (int) Y position
+ * @param int $x X position
+ * @param int $y Y position
* @return int mask
*/
protected function mask4($x, $y) {
@@ -1026,8 +1000,8 @@ class QRcode {
/**
* mask5
- * @param $x (int) X position
- * @param $y (int) Y position
+ * @param int $x X position
+ * @param int $y Y position
* @return int mask
*/
protected function mask5($x, $y) {
@@ -1036,8 +1010,8 @@ class QRcode {
/**
* mask6
- * @param $x (int) X position
- * @param $y (int) Y position
+ * @param int $x X position
+ * @param int $y Y position
* @return int mask
*/
protected function mask6($x, $y) {
@@ -1046,8 +1020,8 @@ class QRcode {
/**
* mask7
- * @param $x (int) X position
- * @param $y (int) Y position
+ * @param int $x X position
+ * @param int $y Y position
* @return int mask
*/
protected function mask7($x, $y) {
@@ -1056,9 +1030,9 @@ class QRcode {
/**
* Return bitmask
- * @param $maskNo (int) mask number
- * @param $width (int) width
- * @param $frame (array) frame
+ * @param int $maskNo mask number
+ * @param int $width width
+ * @param array $frame frame
* @return array bitmask
*/
protected function generateMaskNo($maskNo, $width, $frame) {
@@ -1078,11 +1052,11 @@ class QRcode {
/**
* makeMaskNo
- * @param $maskNo (int)
- * @param $width (int)
- * @param $s (int)
- * @param $d (int)
- * @param $maskGenOnly (boolean)
+ * @param int $maskNo
+ * @param int $width
+ * @param int $s
+ * @param int $d
+ * @param boolean $maskGenOnly
* @return int b
*/
protected function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly=false) {
@@ -1106,10 +1080,10 @@ class QRcode {
/**
* makeMask
- * @param $width (int)
- * @param $frame (array)
- * @param $maskNo (int)
- * @param $level (int)
+ * @param int $width
+ * @param array $frame
+ * @param int $maskNo
+ * @param int $level
* @return array mask
*/
protected function makeMask($width, $frame, $maskNo, $level) {
@@ -1121,7 +1095,7 @@ class QRcode {
/**
* calcN1N3
- * @param $length (int)
+ * @param int $length
* @return int demerit
*/
protected function calcN1N3($length) {
@@ -1151,8 +1125,8 @@ class QRcode {
/**
* evaluateSymbol
- * @param $width (int)
- * @param $frame (array)
+ * @param int $width
+ * @param array $frame
* @return int demerit
*/
protected function evaluateSymbol($width, $frame) {
@@ -1212,9 +1186,9 @@ class QRcode {
/**
* mask
- * @param $width (int)
- * @param $frame (array)
- * @param $level (int)
+ * @param int $width
+ * @param array $frame
+ * @param int $level
* @return array best mask
*/
protected function mask($width, $frame, $level) {
@@ -1255,8 +1229,8 @@ class QRcode {
/**
* Return true if the character at specified position is a number
- * @param $str (string) string
- * @param $pos (int) characted position
+ * @param string $str string
+ * @param int $pos characted position
* @return boolean true of false
*/
protected function isdigitat($str, $pos) {
@@ -1268,8 +1242,8 @@ class QRcode {
/**
* Return true if the character at specified position is an alphanumeric character
- * @param $str (string) string
- * @param $pos (int) characted position
+ * @param string $str string
+ * @param int $pos characted position
* @return boolean true of false
*/
protected function isalnumat($str, $pos) {
@@ -1281,7 +1255,7 @@ class QRcode {
/**
* identifyMode
- * @param $pos (int)
+ * @param int $pos
* @return int mode
*/
protected function identifyMode($pos) {
@@ -1386,6 +1360,7 @@ class QRcode {
$p += 2;
}
$this->items = $this->appendNewInputItem($this->items, QR_MODE_KJ, $p, str_split($this->dataStr));
+ $run = $p;
return $run;
}
@@ -1440,7 +1415,7 @@ class QRcode {
/**
* splitString
- * @return (int)
+ * @return int
*/
protected function splitString() {
while (strlen($this->dataStr) > 0) {
@@ -1455,7 +1430,7 @@ class QRcode {
break;
}
case QR_MODE_KJ: {
- if ($hint == QR_MODE_KJ) {
+ if ($this->hint == QR_MODE_KJ) {
$length = $this->eatKanji();
} else {
$length = $this->eat8();
@@ -1504,10 +1479,10 @@ class QRcode {
/**
* newInputItem
- * @param $mode (int)
- * @param $size (int)
- * @param $data (array)
- * @param $bstream (array)
+ * @param int $mode
+ * @param int $size
+ * @param array $data
+ * @param array $bstream
* @return array input item
*/
protected function newInputItem($mode, $size, $data, $bstream=null) {
@@ -1528,8 +1503,8 @@ class QRcode {
/**
* encodeModeNum
- * @param $inputitem (array)
- * @param $version (int)
+ * @param array $inputitem
+ * @param int $version
* @return array input item
*/
protected function encodeModeNum($inputitem, $version) {
@@ -1557,8 +1532,8 @@ class QRcode {
/**
* encodeModeAn
- * @param $inputitem (array)
- * @param $version (int)
+ * @param array $inputitem
+ * @param int $version
* @return array input item
*/
protected function encodeModeAn($inputitem, $version) {
@@ -1580,8 +1555,8 @@ class QRcode {
/**
* encodeMode8
- * @param $inputitem (array)
- * @param $version (int)
+ * @param array $inputitem
+ * @param int $version
* @return array input item
*/
protected function encodeMode8($inputitem, $version) {
@@ -1596,8 +1571,8 @@ class QRcode {
/**
* encodeModeKanji
- * @param $inputitem (array)
- * @param $version (int)
+ * @param array $inputitem
+ * @param int $version
* @return array input item
*/
protected function encodeModeKanji($inputitem, $version) {
@@ -1620,7 +1595,7 @@ class QRcode {
/**
* encodeModeStructure
- * @param $inputitem (array)
+ * @param array $inputitem
* @return array input item
*/
protected function encodeModeStructure($inputitem) {
@@ -1634,8 +1609,8 @@ class QRcode {
/**
* encodeBitStream
- * @param $inputitem (array)
- * @param $version (int)
+ * @param array $inputitem
+ * @param int $version
* @return array input item
*/
protected function encodeBitStream($inputitem, $version) {
@@ -1686,11 +1661,11 @@ class QRcode {
/**
* Append data to an input object.
* The data is copied and appended to the input object.
- * @param $items (arrray) input items
- * @param $mode (int) encoding mode.
- * @param $size (int) size of data (byte).
- * @param $data (array) array of input data.
- * @return items
+ * @param array $items input items
+ * @param int $mode encoding mode.
+ * @param int $size size of data (byte).
+ * @param array $data array of input data.
+ * @return array items
*
*/
protected function appendNewInputItem($items, $mode, $size, $data) {
@@ -1703,10 +1678,10 @@ class QRcode {
/**
* insertStructuredAppendHeader
- * @param $items (array)
- * @param $size (int)
- * @param $index (int)
- * @param $parity (int)
+ * @param array $items
+ * @param int $size
+ * @param int $index
+ * @param int $parity
* @return array items
*/
protected function insertStructuredAppendHeader($items, $size, $index, $parity) {
@@ -1724,7 +1699,7 @@ class QRcode {
/**
* calcParity
- * @param $items (array)
+ * @param array $items
* @return int parity
*/
protected function calcParity($items) {
@@ -1741,8 +1716,8 @@ class QRcode {
/**
* checkModeNum
- * @param $size (int)
- * @param $data (array)
+ * @param int $size
+ * @param array $data
* @return boolean true or false
*/
protected function checkModeNum($size, $data) {
@@ -1755,9 +1730,9 @@ class QRcode {
}
/**
- * Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19).
- * @param $c (int) character value
- * @return value
+ * Look up the alphabet-numeric conversion table (see JIS X0510:2004, pp.19).
+ * @param int $c character value
+ * @return int value
*/
protected function lookAnTable($c) {
return (($c > 127)?-1:$this->anTable[$c]);
@@ -1765,8 +1740,8 @@ class QRcode {
/**
* checkModeAn
- * @param $size (int)
- * @param $data (array)
+ * @param int $size
+ * @param array $data
* @return boolean true or false
*/
protected function checkModeAn($size, $data) {
@@ -1780,7 +1755,7 @@ class QRcode {
/**
* estimateBitsModeNum
- * @param $size (int)
+ * @param int $size
* @return int number of bits
*/
protected function estimateBitsModeNum($size) {
@@ -1801,7 +1776,7 @@ class QRcode {
/**
* estimateBitsModeAn
- * @param $size (int)
+ * @param int $size
* @return int number of bits
*/
protected function estimateBitsModeAn($size) {
@@ -1814,7 +1789,7 @@ class QRcode {
/**
* estimateBitsMode8
- * @param $size (int)
+ * @param int $size
* @return int number of bits
*/
protected function estimateBitsMode8($size) {
@@ -1823,7 +1798,7 @@ class QRcode {
/**
* estimateBitsModeKanji
- * @param $size (int)
+ * @param int $size
* @return int number of bits
*/
protected function estimateBitsModeKanji($size) {
@@ -1832,8 +1807,8 @@ class QRcode {
/**
* checkModeKanji
- * @param $size (int)
- * @param $data (array)
+ * @param int $size
+ * @param array $data
* @return boolean true or false
*/
protected function checkModeKanji($size, $data) {
@@ -1851,9 +1826,9 @@ class QRcode {
/**
* Validate the input data.
- * @param $mode (int) encoding mode.
- * @param $size (int) size of data (byte).
- * @param $data (array) data to validate
+ * @param int $mode encoding mode.
+ * @param int $size size of data (byte).
+ * @param array $data data to validate
* @return boolean true in case of valid data, false otherwise
*/
protected function check($mode, $size, $data) {
@@ -1885,8 +1860,8 @@ class QRcode {
/**
* estimateBitStreamSize
- * @param $items (array)
- * @param $version (int)
+ * @param array $items
+ * @param int $version
* @return int bits
*/
protected function estimateBitStreamSize($items, $version) {
@@ -1929,7 +1904,7 @@ class QRcode {
/**
* estimateVersion
- * @param $items (array)
+ * @param array $items
* @return int version
*/
protected function estimateVersion($items) {
@@ -1948,9 +1923,9 @@ class QRcode {
/**
* lengthOfCode
- * @param $mode (int)
- * @param $version (int)
- * @param $bits (int)
+ * @param int $mode
+ * @param int $version
+ * @param int $bits
* @return int size
*/
protected function lengthOfCode($mode, $version, $bits) {
@@ -2005,7 +1980,7 @@ class QRcode {
/**
* createBitStream
- * @param $items (array)
+ * @param array $items
* @return array of items and total bits
*/
protected function createBitStream($items) {
@@ -2020,7 +1995,7 @@ class QRcode {
/**
* convertData
- * @param $items (array)
+ * @param array $items
* @return array items
*/
protected function convertData($items) {
@@ -2049,7 +2024,7 @@ class QRcode {
/**
* Append Padding Bit to bitstream
- * @param $bstream (array)
+ * @param array $bstream
* @return array bitstream
*/
protected function appendPaddingBit($bstream) {
@@ -2082,7 +2057,7 @@ class QRcode {
/**
* mergeBitStream
- * @param $items (array) items
+ * @param array $items items
* @return array bitstream
*/
protected function mergeBitStream($items) {
@@ -2099,7 +2074,7 @@ class QRcode {
/**
* Returns a stream of bits.
- * @param $items (int)
+ * @param int $items
* @return array padded merged byte stream
*/
protected function getBitStream($items) {
@@ -2109,7 +2084,7 @@ class QRcode {
/**
* Pack all bit streams padding bits into a byte array.
- * @param $items (int)
+ * @param int $items
* @return array padded merged byte stream
*/
protected function getByteStream($items) {
@@ -2123,7 +2098,7 @@ class QRcode {
/**
* Return an array with zeros
- * @param $setLength (int) array size
+ * @param int $setLength array size
* @return array
*/
protected function allocate($setLength) {
@@ -2132,8 +2107,8 @@ class QRcode {
/**
* Return new bitstream from number
- * @param $bits (int) number of bits
- * @param $num (int) number
+ * @param int $bits number of bits
+ * @param int $num number
* @return array bitstream
*/
protected function newFromNum($bits, $num) {
@@ -2152,8 +2127,8 @@ class QRcode {
/**
* Return new bitstream from bytes
- * @param $size (int) size
- * @param $data (array) bytes
+ * @param int $size size
+ * @param array $data bytes
* @return array bitstream
*/
protected function newFromBytes($size, $data) {
@@ -2176,8 +2151,8 @@ class QRcode {
/**
* Append one bitstream to another
- * @param $bitstream (array) original bitstream
- * @param $append (array) bitstream to append
+ * @param array $bitstream original bitstream
+ * @param array $append bitstream to append
* @return array bitstream
*/
protected function appendBitstream($bitstream, $append) {
@@ -2192,9 +2167,9 @@ class QRcode {
/**
* Append one bitstream created from number to another
- * @param $bitstream (array) original bitstream
- * @param $bits (int) number of bits
- * @param $num (int) number
+ * @param array $bitstream original bitstream
+ * @param int $bits number of bits
+ * @param int $num number
* @return array bitstream
*/
protected function appendNum($bitstream, $bits, $num) {
@@ -2207,9 +2182,9 @@ class QRcode {
/**
* Append one bitstream created from bytes to another
- * @param $bitstream (array) original bitstream
- * @param $size (int) size
- * @param $data (array) bytes
+ * @param array $bitstream original bitstream
+ * @param int $size size
+ * @param array $data bytes
* @return array bitstream
*/
protected function appendBytes($bitstream, $size, $data) {
@@ -2222,7 +2197,7 @@ class QRcode {
/**
* Convert bitstream to bytes
- * @param $bstream (array) original bitstream
+ * @param array $bstream original bitstream
* @return array of bytes
*/
protected function bitstreamToByte($bstream) {
@@ -2263,11 +2238,11 @@ class QRcode {
/**
* Replace a value on the array at the specified position
- * @param $srctab (array)
- * @param $x (int) X position
- * @param $y (int) Y position
- * @param $repl (string) value to replace
- * @param $replLen (int) length of the repl string
+ * @param array $srctab
+ * @param int $x X position
+ * @param int $y Y position
+ * @param string $repl value to replace
+ * @param int $replLen length of the repl string
* @return array srctab
*/
protected function qrstrset($srctab, $x, $y, $repl, $replLen=false) {
@@ -2277,8 +2252,8 @@ class QRcode {
/**
* Return maximum data code length (bytes) for the version.
- * @param $version (int) version
- * @param $level (int) error correction level
+ * @param int $version version
+ * @param int $level error correction level
* @return int maximum size (bytes)
*/
protected function getDataLength($version, $level) {
@@ -2287,8 +2262,8 @@ class QRcode {
/**
* Return maximum error correction code length (bytes) for the version.
- * @param $version (int) version
- * @param $level (int) error correction level
+ * @param int $version version
+ * @param int $level error correction level
* @return int ECC size (bytes)
*/
protected function getECCLength($version, $level){
@@ -2297,7 +2272,7 @@ class QRcode {
/**
* Return the width of the symbol for the version.
- * @param $version (int) version
+ * @param int $version version
* @return int width
*/
protected function getWidth($version) {
@@ -2306,7 +2281,7 @@ class QRcode {
/**
* Return the numer of remainder bits.
- * @param $version (int) version
+ * @param int $version version
* @return int number of remainder bits
*/
protected function getRemainder($version) {
@@ -2315,8 +2290,8 @@ class QRcode {
/**
* Return a version number that satisfies the input code length.
- * @param $size (int) input code length (bytes)
- * @param $level (int) error correction level
+ * @param int $size input code length (bytes)
+ * @param int $level error correction level
* @return int version number
*/
protected function getMinimumVersion($size, $level) {
@@ -2332,8 +2307,8 @@ class QRcode {
/**
* Return the size of length indicator for the mode and version.
- * @param $mode (int) encoding mode
- * @param $version (int) version
+ * @param int $mode encoding mode
+ * @param int $version version
* @return int the size of the appropriate length indicator (bits).
*/
protected function lengthIndicator($mode, $version) {
@@ -2352,8 +2327,8 @@ class QRcode {
/**
* Return the maximum length for the mode and version.
- * @param $mode (int) encoding mode
- * @param $version (int) version
+ * @param int $mode encoding mode
+ * @param int $version version
* @return int the maximum length (bytes)
*/
protected function maximumWords($mode, $version) {
@@ -2377,9 +2352,9 @@ class QRcode {
/**
* Return an array of ECC specification.
- * @param $version (int) version
- * @param $level (int) error correction level
- * @param $spec (array) an array of ECC specification contains as following: {# of type1 blocks, # of data code, # of ecc code, # of type2 blocks, # of data code}
+ * @param int $version version
+ * @param int $level error correction level
+ * @param array $spec an array of ECC specification contains as following: {# of type1 blocks, # of data code, # of ecc code, # of type2 blocks, # of data code}
* @return array spec
*/
protected function getEccSpec($version, $level, $spec) {
@@ -2408,9 +2383,9 @@ class QRcode {
/**
* Put an alignment marker.
- * @param $frame (array) frame
- * @param $ox (int) X center coordinate of the pattern
- * @param $oy (int) Y center coordinate of the pattern
+ * @param array $frame frame
+ * @param int $ox X center coordinate of the pattern
+ * @param int $oy Y center coordinate of the pattern
* @return array frame
*/
protected function putAlignmentMarker($frame, $ox, $oy) {
@@ -2431,9 +2406,9 @@ class QRcode {
/**
* Put an alignment pattern.
- * @param $version (int) version
- * @param $frame (array) frame
- * @param $width (int) width
+ * @param int $version version
+ * @param array $frame frame
+ * @param int $width width
* @return array frame
*/
protected function putAlignmentPattern($version, $frame, $width) {
@@ -2473,8 +2448,8 @@ class QRcode {
/**
* Return BCH encoded version information pattern that is used for the symbol of version 7 or greater. Use lower 18 bits.
- * @param $version (int) version
- * @return BCH encoded version information pattern
+ * @param int $version version
+ * @return string BCH encoded version information pattern
*/
protected function getVersionPattern($version) {
if (($version < 7) OR ($version > QRSPEC_VERSION_MAX)) {
@@ -2485,9 +2460,9 @@ class QRcode {
/**
* Return BCH encoded format information pattern.
- * @param $mask (array)
- * @param $level (int) error correction level
- * @return BCH encoded format information pattern
+ * @param array $mask
+ * @param int $level error correction level
+ * @return string BCH encoded format information pattern
*/
protected function getFormatInfo($mask, $level) {
if (($mask < 0) OR ($mask > 7)) {
@@ -2501,9 +2476,9 @@ class QRcode {
/**
* Put a finder pattern.
- * @param $frame (array) frame
- * @param $ox (int) X center coordinate of the pattern
- * @param $oy (int) Y center coordinate of the pattern
+ * @param array $frame frame
+ * @param int $ox X center coordinate of the pattern
+ * @param int $oy Y center coordinate of the pattern
* @return array frame
*/
protected function putFinderPattern($frame, $ox, $oy) {
@@ -2524,8 +2499,8 @@ class QRcode {
/**
* Return a copy of initialized frame.
- * @param $version (int) version
- * @return Array of unsigned char.
+ * @param int $version version
+ * @return array array of unsigned char.
*/
protected function createFrame($version) {
$width = $this->capacity[$version][QRCAP_WIDTH];
@@ -2589,8 +2564,8 @@ class QRcode {
/**
* Set new frame for the specified version.
- * @param $version (int) version
- * @return Array of unsigned char.
+ * @param int $version version
+ * @return array array of unsigned char.
*/
protected function newFrame($version) {
if (($version < 1) OR ($version > QRSPEC_VERSION_MAX)) {
@@ -2607,7 +2582,7 @@ class QRcode {
/**
* Return block number 0
- * @param $spec (array)
+ * @param array $spec
* @return int value
*/
protected function rsBlockNum($spec) {
@@ -2616,7 +2591,7 @@ class QRcode {
/**
* Return block number 1
- * @param $spec (array)
+ * @param array $spec
* @return int value
*/
protected function rsBlockNum1($spec) {
@@ -2625,7 +2600,7 @@ class QRcode {
/**
* Return data codes 1
- * @param $spec (array)
+ * @param array $spec
* @return int value
*/
protected function rsDataCodes1($spec) {
@@ -2634,7 +2609,7 @@ class QRcode {
/**
* Return ecc codes 1
- * @param $spec (array)
+ * @param array $spec
* @return int value
*/
protected function rsEccCodes1($spec) {
@@ -2643,7 +2618,7 @@ class QRcode {
/**
* Return block number 2
- * @param $spec (array)
+ * @param array $spec
* @return int value
*/
protected function rsBlockNum2($spec) {
@@ -2652,7 +2627,7 @@ class QRcode {
/**
* Return data codes 2
- * @param $spec (array)
+ * @param array $spec
* @return int value
*/
protected function rsDataCodes2($spec) {
@@ -2661,7 +2636,7 @@ class QRcode {
/**
* Return ecc codes 2
- * @param $spec (array)
+ * @param array $spec
* @return int value
*/
protected function rsEccCodes2($spec) {
@@ -2670,7 +2645,7 @@ class QRcode {
/**
* Return data length
- * @param $spec (array)
+ * @param array $spec
* @return int value
*/
protected function rsDataLength($spec) {
@@ -2679,7 +2654,7 @@ class QRcode {
/**
* Return ecc length
- * @param $spec (array)
+ * @param array $spec
* @return int value
*/
protected function rsEccLength($spec) {
@@ -2692,12 +2667,12 @@ class QRcode {
/**
* Initialize a Reed-Solomon codec and add it to existing rsitems
- * @param $symsize (int) symbol size, bits
- * @param $gfpoly (int) Field generator polynomial coefficients
- * @param $fcr (int) first root of RS code generator polynomial, index form
- * @param $prim (int) primitive element to generate polynomial roots
- * @param $nroots (int) RS code generator polynomial degree (number of roots)
- * @param $pad (int) padding bytes at front of shortened block
+ * @param int $symsize symbol size, bits
+ * @param int $gfpoly Field generator polynomial coefficients
+ * @param int $fcr first root of RS code generator polynomial, index form
+ * @param int $prim primitive element to generate polynomial roots
+ * @param int $nroots RS code generator polynomial degree (number of roots)
+ * @param int $pad padding bytes at front of shortened block
* @return array Array of RS values:
mm = Bits per symbol;
nn = Symbols per block;
alpha_to = log lookup table array;
index_of = Antilog lookup table array;
genpoly = Generator polynomial array;
nroots = Number of generator;
roots = number of parity symbols;
fcr = First consecutive root, index form;
prim = Primitive element, index form;
iprim = prim-th root of 1, index form;
pad = Padding bytes in shortened block;
gfpoly
.
*/
protected function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) {
@@ -2719,8 +2694,8 @@ class QRcode {
/**
* modnn
- * @param $rs (array) RS values
- * @param $x (int) X position
+ * @param array $rs RS values
+ * @param int $x X position
* @return int X osition
*/
protected function modnn($rs, $x) {
@@ -2733,12 +2708,12 @@ class QRcode {
/**
* Initialize a Reed-Solomon codec and returns an array of values.
- * @param $symsize (int) symbol size, bits
- * @param $gfpoly (int) Field generator polynomial coefficients
- * @param $fcr (int) first root of RS code generator polynomial, index form
- * @param $prim (int) primitive element to generate polynomial roots
- * @param $nroots (int) RS code generator polynomial degree (number of roots)
- * @param $pad (int) padding bytes at front of shortened block
+ * @param int $symsize symbol size, bits
+ * @param int $gfpoly Field generator polynomial coefficients
+ * @param int $fcr first root of RS code generator polynomial, index form
+ * @param int $prim primitive element to generate polynomial roots
+ * @param int $nroots RS code generator polynomial degree (number of roots)
+ * @param int $pad padding bytes at front of shortened block
* @return array Array of RS values:
mm = Bits per symbol;
nn = Symbols per block;
alpha_to = log lookup table array;
index_of = Antilog lookup table array;
genpoly = Generator polynomial array;
nroots = Number of generator;
roots = number of parity symbols;
fcr = First consecutive root, index form;
prim = Primitive element, index form;
iprim = prim-th root of 1, index form;
pad = Padding bytes in shortened block;
gfpoly
.
*/
protected function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) {
@@ -2820,9 +2795,9 @@ class QRcode {
/**
* Encode a Reed-Solomon codec and returns the parity array
- * @param $rs (array) RS values
- * @param $data (array) data
- * @param $parity (array) parity
+ * @param array $rs RS values
+ * @param array $data data
+ * @param array $parity parity
* @return parity array
*/
protected function encode_rs_char($rs, $data, $parity) {
diff --git a/lib/combodo/tcpdf/include/tcpdf_colors.php b/lib/combodo/tcpdf/include/tcpdf_colors.php
index 27fb7afd1..7f337f31a 100644
--- a/lib/combodo/tcpdf/include/tcpdf_colors.php
+++ b/lib/combodo/tcpdf/include/tcpdf_colors.php
@@ -240,9 +240,9 @@ class TCPDF_COLORS {
/**
* Return the Spot color array.
- * @param $name (string) Name of the spot color.
- * @param $spotc (array) Reference to an array of spot colors.
- * @return (array) Spot color array or false if not defined.
+ * @param string $name Name of the spot color.
+ * @param array $spotc Reference to an array of spot colors.
+ * @return array|false Spot color array or false if not defined.
* @since 5.9.125 (2011-10-03)
* @public static
*/
@@ -264,10 +264,10 @@ class TCPDF_COLORS {
/**
* Returns an array (RGB or CMYK) from an html color name, or a six-digit (i.e. #3FE5AA), or three-digit (i.e. #7FF) hexadecimal color, or a javascript color array, or javascript color name.
- * @param $hcolor (string) HTML color.
- * @param $spotc (array) Reference to an array of spot colors.
- * @param $defcol (array) Color to return in case of error.
- * @return array RGB or CMYK color, or false in case of error.
+ * @param string $hcolor HTML color.
+ * @param array $spotc Reference to an array of spot colors.
+ * @param array $defcol Color to return in case of error.
+ * @return array|false RGB or CMYK color, or false in case of error.
* @public static
*/
public static function convertHTMLColorToDec($hcolor, &$spotc, $defcol=array('R'=>128,'G'=>128,'B'=>128)) {
@@ -407,8 +407,8 @@ class TCPDF_COLORS {
/**
* Convert a color array into a string representation.
- * @param $c (array) Array of colors.
- * @return (string) The color array representation.
+ * @param array $c Array of colors.
+ * @return string The color array representation.
* @since 5.9.137 (2011-12-01)
* @public static
*/
@@ -438,7 +438,7 @@ class TCPDF_COLORS {
/**
* Convert color to javascript color.
- * @param $color (string) color name or "#RRGGBB"
+ * @param string $color color name or "#RRGGBB"
* @protected
* @since 2.1.002 (2008-02-12)
* @public static
@@ -449,7 +449,7 @@ class TCPDF_COLORS {
}
if (!in_array($color, self::$jscolor)) {
// default transparent color
- $color = $jscolor[0];
+ $color = self::$jscolor[0];
}
return 'color.'.$color;
}
diff --git a/lib/combodo/tcpdf/include/tcpdf_filters.php b/lib/combodo/tcpdf/include/tcpdf_filters.php
index 3bb89c092..3009cff7c 100644
--- a/lib/combodo/tcpdf/include/tcpdf_filters.php
+++ b/lib/combodo/tcpdf/include/tcpdf_filters.php
@@ -60,7 +60,7 @@ class TCPDF_FILTERS {
/**
* Get a list of available decoding filters.
- * @return (array) Array of available filter decoders.
+ * @return array Array of available filter decoders.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -70,9 +70,9 @@ class TCPDF_FILTERS {
/**
* Decode data using the specified filter type.
- * @param $filter (string) Filter name.
- * @param $data (string) Data to decode.
- * @return Decoded data string.
+ * @param string $filter Filter name.
+ * @param string $data Data to decode.
+ * @return string Decoded data string.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -130,8 +130,8 @@ class TCPDF_FILTERS {
/**
* Standard
* Default decoding filter (leaves data unchanged).
- * @param $data (string) Data to decode.
- * @return Decoded data string.
+ * @param string $data Data to decode.
+ * @return string Decoded data string.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -142,8 +142,8 @@ class TCPDF_FILTERS {
/**
* ASCIIHexDecode
* Decodes data encoded in an ASCII hexadecimal representation, reproducing the original binary data.
- * @param $data (string) Data to decode.
- * @return Decoded data string.
+ * @param string $data Data to decode.
+ * @return string Decoded data string.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -182,8 +182,8 @@ class TCPDF_FILTERS {
/**
* ASCII85Decode
* Decodes data encoded in an ASCII base-85 representation, reproducing the original binary data.
- * @param $data (string) Data to decode.
- * @return Decoded data string.
+ * @param string $data Data to decode.
+ * @return string Decoded data string.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -266,8 +266,8 @@ class TCPDF_FILTERS {
/**
* LZWDecode
* Decompresses data encoded using the LZW (Lempel-Ziv-Welch) adaptive compression method, reproducing the original text or binary data.
- * @param $data (string) Data to decode.
- * @return Decoded data string.
+ * @param string $data Data to decode.
+ * @return string Decoded data string.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -347,8 +347,8 @@ class TCPDF_FILTERS {
/**
* FlateDecode
* Decompresses data encoded using the zlib/deflate compression method, reproducing the original text or binary data.
- * @param $data (string) Data to decode.
- * @return Decoded data string.
+ * @param string $data Data to decode.
+ * @return string Decoded data string.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -364,7 +364,7 @@ class TCPDF_FILTERS {
/**
* RunLengthDecode
* Decompresses data encoded using a byte-oriented run-length encoding algorithm.
- * @param $data (string) Data to decode.
+ * @param string $data Data to decode.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -400,8 +400,8 @@ class TCPDF_FILTERS {
/**
* CCITTFaxDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
* Decompresses data encoded using the CCITT facsimile standard, reproducing the original data (typically monochrome image data at 1 bit per pixel).
- * @param $data (string) Data to decode.
- * @return Decoded data string.
+ * @param string $data Data to decode.
+ * @return string Decoded data string.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -413,8 +413,8 @@ class TCPDF_FILTERS {
/**
* JBIG2Decode (NOT IMPLEMETED - RETURN AN EXCEPTION)
* Decompresses data encoded using the JBIG2 standard, reproducing the original monochrome (1 bit per pixel) image data (or an approximation of that data).
- * @param $data (string) Data to decode.
- * @return Decoded data string.
+ * @param string $data Data to decode.
+ * @return string Decoded data string.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -426,8 +426,8 @@ class TCPDF_FILTERS {
/**
* DCTDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
* Decompresses data encoded using a DCT (discrete cosine transform) technique based on the JPEG standard, reproducing image sample data that approximates the original data.
- * @param $data (string) Data to decode.
- * @return Decoded data string.
+ * @param string $data Data to decode.
+ * @return string Decoded data string.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -439,8 +439,8 @@ class TCPDF_FILTERS {
/**
* JPXDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
* Decompresses data encoded using the wavelet-based JPEG2000 standard, reproducing the original image data.
- * @param $data (string) Data to decode.
- * @return Decoded data string.
+ * @param string $data Data to decode.
+ * @return string Decoded data string.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -452,8 +452,8 @@ class TCPDF_FILTERS {
/**
* Crypt (NOT IMPLEMETED - RETURN AN EXCEPTION)
* Decrypts data encrypted by a security handler, reproducing the data as it was before encryption.
- * @param $data (string) Data to decode.
- * @return Decoded data string.
+ * @param string $data Data to decode.
+ * @return string Decoded data string.
* @since 1.0.000 (2011-05-23)
* @public static
*/
@@ -466,7 +466,7 @@ class TCPDF_FILTERS {
/**
* Throw an exception.
- * @param $msg (string) The error message
+ * @param string $msg The error message
* @since 1.0.000 (2011-05-23)
* @public static
*/
diff --git a/lib/combodo/tcpdf/include/tcpdf_fonts.php b/lib/combodo/tcpdf/include/tcpdf_fonts.php
index 218fb6df1..c692ef87d 100644
--- a/lib/combodo/tcpdf/include/tcpdf_fonts.php
+++ b/lib/combodo/tcpdf/include/tcpdf_fonts.php
@@ -55,16 +55,16 @@ class TCPDF_FONTS {
/**
* Convert and add the selected TrueType or Type1 font to the fonts folder (that must be writeable).
- * @param $fontfile (string) Font file (full path).
- * @param $fonttype (string) Font type. Leave empty for autodetect mode. Valid values are: TrueTypeUnicode, TrueType, Type1, CID0JP = CID-0 Japanese, CID0KR = CID-0 Korean, CID0CS = CID-0 Chinese Simplified, CID0CT = CID-0 Chinese Traditional.
- * @param $enc (string) Name of the encoding table to use. Leave empty for default mode. Omit this parameter for TrueType Unicode and symbolic fonts like Symbol or ZapfDingBats.
- * @param $flags (int) Unsigned 32-bit integer containing flags specifying various characteristics of the font (PDF32000:2008 - 9.8.2 Font Descriptor Flags): +1 for fixed font; +4 for symbol or +32 for non-symbol; +64 for italic. Fixed and Italic mode are generally autodetected so you have to set it to 32 = non-symbolic font (default) or 4 = symbolic font.
- * @param $outpath (string) Output path for generated font files (must be writeable by the web server). Leave empty for default font folder.
- * @param $platid (int) Platform ID for CMAP table to extract (when building a Unicode font for Windows this value should be 3, for Macintosh should be 1).
- * @param $encid (int) Encoding ID for CMAP table to extract (when building a Unicode font for Windows this value should be 1, for Macintosh should be 0). When Platform ID is 3, legal values for Encoding ID are: 0=Symbol, 1=Unicode, 2=ShiftJIS, 3=PRC, 4=Big5, 5=Wansung, 6=Johab, 7=Reserved, 8=Reserved, 9=Reserved, 10=UCS-4.
- * @param $addcbbox (boolean) If true includes the character bounding box information on the php font file.
- * @param $link (boolean) If true link to system font instead of copying the font data (not transportable) - Note: do not work with Type1 fonts.
- * @return (string) TCPDF font name or boolean false in case of error.
+ * @param string $fontfile Font file (full path).
+ * @param string $fonttype Font type. Leave empty for autodetect mode. Valid values are: TrueTypeUnicode, TrueType, Type1, CID0JP = CID-0 Japanese, CID0KR = CID-0 Korean, CID0CS = CID-0 Chinese Simplified, CID0CT = CID-0 Chinese Traditional.
+ * @param string $enc Name of the encoding table to use. Leave empty for default mode. Omit this parameter for TrueType Unicode and symbolic fonts like Symbol or ZapfDingBats.
+ * @param int $flags Unsigned 32-bit integer containing flags specifying various characteristics of the font (PDF32000:2008 - 9.8.2 Font Descriptor Flags): +1 for fixed font; +4 for symbol or +32 for non-symbol; +64 for italic. Fixed and Italic mode are generally autodetected so you have to set it to 32 = non-symbolic font (default) or 4 = symbolic font.
+ * @param string $outpath Output path for generated font files (must be writeable by the web server). Leave empty for default font folder.
+ * @param int $platid Platform ID for CMAP table to extract (when building a Unicode font for Windows this value should be 3, for Macintosh should be 1).
+ * @param int $encid Encoding ID for CMAP table to extract (when building a Unicode font for Windows this value should be 1, for Macintosh should be 0). When Platform ID is 3, legal values for Encoding ID are: 0=Symbol, 1=Unicode, 2=ShiftJIS, 3=PRC, 4=Big5, 5=Wansung, 6=Johab, 7=Reserved, 8=Reserved, 9=Reserved, 10=UCS-4.
+ * @param boolean $addcbbox If true includes the character bounding box information on the php font file.
+ * @param boolean $link If true link to system font instead of copying the font data (not transportable) - Note: do not work with Type1 fonts.
+ * @return string|false TCPDF font name or boolean false in case of error.
* @author Nicola Asuni
* @since 5.9.123 (2010-09-30)
* @public static
@@ -557,6 +557,7 @@ class TCPDF_FONTS {
$numGlyphs = TCPDF_STATIC::_getUSHORT($font, $offset);
// ---------- get CIDToGIDMap ----------
$ctg = array();
+ $c = 0;
foreach ($encodingTables as $enctable) {
// get only specified Platform ID and Encoding ID
if (($enctable['platformID'] == $platid) AND ($enctable['encodingID'] == $encid)) {
@@ -920,8 +921,8 @@ class TCPDF_FONTS {
/**
* Returs the checksum of a TTF table.
- * @param $table (string) table to check
- * @param $length (int) length of table in bytes
+ * @param string $table table to check
+ * @param int $length length of table in bytes
* @return int checksum
* @author Nicola Asuni
* @since 5.2.000 (2010-06-02)
@@ -942,9 +943,9 @@ class TCPDF_FONTS {
/**
* Returns a subset of the TrueType font data without the unused glyphs.
- * @param $font (string) TrueType font data.
- * @param $subsetchars (array) Array of used characters (the glyphs to keep).
- * @return (string) A subset of TrueType font data without the unused glyphs.
+ * @param string $font TrueType font data.
+ * @param array $subsetchars Array of used characters (the glyphs to keep).
+ * @return string A subset of TrueType font data without the unused glyphs.
* @author Nicola Asuni
* @since 5.2.000 (2010-06-02)
* @public static
@@ -956,6 +957,7 @@ class TCPDF_FONTS {
// sfnt version must be 0x00010000 for TrueType version 1.0.
return $font;
}
+ $c = 0;
$offset += 4;
// get number of tables
$numTables = TCPDF_STATIC::_getUSHORT($font, $offset);
@@ -1387,9 +1389,9 @@ class TCPDF_FONTS {
/**
* Outputs font widths
- * @param $font (array) font data
- * @param $cidoffset (int) offset for CID values
- * @return PDF command string for font widths
+ * @param array $font font data
+ * @param int $cidoffset offset for CID values
+ * @return string PDF command string for font widths
* @author Nicola Asuni
* @since 4.4.000 (2008-12-07)
* @public static
@@ -1495,10 +1497,10 @@ class TCPDF_FONTS {
/**
* Update the CIDToGIDMap string with a new value.
- * @param $map (string) CIDToGIDMap.
- * @param $cid (int) CID value.
- * @param $gid (int) GID value.
- * @return (string) CIDToGIDMap.
+ * @param string $map CIDToGIDMap.
+ * @param int $cid CID value.
+ * @param int $gid GID value.
+ * @return string CIDToGIDMap.
* @author Nicola Asuni
* @since 5.9.123 (2011-09-29)
* @public static
@@ -1533,8 +1535,8 @@ class TCPDF_FONTS {
/**
* Return font full path
- * @param $file (string) Font file name.
- * @param $fontdir (string) Font directory (set to false fto search on default directories)
+ * @param string $file Font file name.
+ * @param string $fontdir Font directory (set to false fto search on default directories)
* @return string Font full path or empty string
* @author Nicola Asuni
* @since 6.0.025
@@ -1558,8 +1560,8 @@ class TCPDF_FONTS {
/**
* Get a reference font size.
- * @param $size (string) String containing font size value.
- * @param $refsize (float) Reference font size in points.
+ * @param string $size String containing font size value.
+ * @param float $refsize Reference font size in points.
* @return float value in points
* @public static
*/
@@ -1657,9 +1659,9 @@ class TCPDF_FONTS {
/**
* Returns the unicode caracter specified by the value
- * @param $c (int) UTF-8 value
- * @param $unicode (boolean) True if we are in unicode mode, false otherwise.
- * @return Returns the specified character.
+ * @param int $c UTF-8 value
+ * @param boolean $unicode True if we are in unicode mode, false otherwise.
+ * @return string Returns the specified character.
* @since 2.3.000 (2008-03-05)
* @public static
*/
@@ -1686,8 +1688,8 @@ class TCPDF_FONTS {
/**
* Returns the unicode caracter specified by UTF-8 value
- * @param $c (int) UTF-8 value
- * @return Returns the specified character.
+ * @param int $c UTF-8 value
+ * @return string Returns the specified character.
* @public static
*/
public static function unichrUnicode($c) {
@@ -1696,8 +1698,8 @@ class TCPDF_FONTS {
/**
* Returns the unicode caracter specified by ASCII value
- * @param $c (int) UTF-8 value
- * @return Returns the specified character.
+ * @param int $c UTF-8 value
+ * @return string Returns the specified character.
* @public static
*/
public static function unichrASCII($c) {
@@ -1734,8 +1736,8 @@ class TCPDF_FONTS {
* W1 = 110110yyyyyyyyyy
* W2 = 110111xxxxxxxxxx
*
- * @param $unicode (array) array containing UTF-8 unicode values
- * @param $setbom (boolean) if true set the Byte Order Mark (BOM = 0xFEFF)
+ * @param array $unicode array containing UTF-8 unicode values
+ * @param boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF)
* @return string
* @protected
* @author Nicola Asuni
@@ -1770,9 +1772,9 @@ class TCPDF_FONTS {
/**
* Convert an array of UTF8 values to array of unicode characters
- * @param $ta (array) The input array of UTF8 values.
- * @param $isunicode (boolean) True for Unicode mode, false otherwise.
- * @return Return array of unicode characters
+ * @param array $ta The input array of UTF8 values.
+ * @param boolean $isunicode True for Unicode mode, false otherwise.
+ * @return array Return array of unicode characters
* @since 4.5.037 (2009-04-07)
* @public static
*/
@@ -1785,11 +1787,11 @@ class TCPDF_FONTS {
/**
* Extract a slice of the $strarr array and return it as string.
- * @param $strarr (string) The input array of characters.
- * @param $start (int) the starting element of $strarr.
- * @param $end (int) first element that will not be returned.
- * @param $unicode (boolean) True if we are in unicode mode, false otherwise.
- * @return Return part of a string
+ * @param string[] $strarr The input array of characters.
+ * @param int $start the starting element of $strarr.
+ * @param int $end first element that will not be returned.
+ * @param boolean $unicode True if we are in unicode mode, false otherwise.
+ * @return string Return part of a string
* @public static
*/
public static function UTF8ArrSubString($strarr, $start='', $end='', $unicode=true) {
@@ -1808,10 +1810,10 @@ class TCPDF_FONTS {
/**
* Extract a slice of the $uniarr array and return it as string.
- * @param $uniarr (string) The input array of characters.
- * @param $start (int) the starting element of $strarr.
- * @param $end (int) first element that will not be returned.
- * @return Return part of a string
+ * @param string[] $uniarr The input array of characters.
+ * @param int $start the starting element of $strarr.
+ * @param int $end first element that will not be returned.
+ * @return string Return part of a string
* @since 4.5.037 (2009-04-07)
* @public static
*/
@@ -1831,7 +1833,7 @@ class TCPDF_FONTS {
/**
* Converts UTF-8 characters array to array of Latin1 characters array
- * @param $unicode (array) array containing UTF-8 unicode values
+ * @param array $unicode array containing UTF-8 unicode values
* @return array
* @author Nicola Asuni
* @since 4.8.023 (2010-01-15)
@@ -1855,9 +1857,9 @@ class TCPDF_FONTS {
}
/**
- * Converts UTF-8 characters array to array of Latin1 string
- * @param $unicode (array) array containing UTF-8 unicode values
- * @return array
+ * Converts UTF-8 characters array to Latin1 string
+ * @param array $unicode array containing UTF-8 unicode values
+ * @return string
* @author Nicola Asuni
* @since 4.8.023 (2010-01-15)
* @public static
@@ -1882,8 +1884,8 @@ class TCPDF_FONTS {
/**
* Converts UTF-8 character to integer value.
* Uses the getUniord() method if the value is not cached.
- * @param $uch (string) character string to process.
- * @return integer Unicode value
+ * @param string $uch character string to process.
+ * @return int Unicode value
* @public static
*/
public static function uniord($uch) {
@@ -1921,8 +1923,8 @@ class TCPDF_FONTS {
* UTF8-tail = %x80-BF
* ---------------------------------------------------------------------
*
- * @param $uch (string) character string to process.
- * @return integer Unicode value
+ * @param string $uch character string to process.
+ * @return int Unicode value
* @author Nicola Asuni
* @public static
*/
@@ -1988,14 +1990,14 @@ class TCPDF_FONTS {
/**
* Converts UTF-8 strings to codepoints array.
* Invalid byte sequences will be replaced with 0xFFFD (replacement character)
- * @param $str (string) string to process.
- * @param $isunicode (boolean) True when the documetn is in Unicode mode, false otherwise.
- * @param $currentfont (array) Reference to current font array.
+ * @param string $str string to process.
+ * @param boolean $isunicode True when the documetn is in Unicode mode, false otherwise.
+ * @param array $currentfont Reference to current font array.
* @return array containing codepoints (UTF-8 characters values)
* @author Nicola Asuni
* @public static
*/
- public static function UTF8StringToArray($str, $isunicode=true, &$currentfont) {
+ public static function UTF8StringToArray($str, $isunicode, &$currentfont) {
if ($isunicode) {
// requires PCRE unicode support turned on
$chars = TCPDF_STATIC::pregSplit('//','u', $str, -1, PREG_SPLIT_NO_EMPTY);
@@ -2014,30 +2016,30 @@ class TCPDF_FONTS {
/**
* Converts UTF-8 strings to Latin1 when using the standard 14 core fonts.
- * @param $str (string) string to process.
- * @param $isunicode (boolean) True when the documetn is in Unicode mode, false otherwise.
- * @param $currentfont (array) Reference to current font array.
+ * @param string $str string to process.
+ * @param boolean $isunicode True when the documetn is in Unicode mode, false otherwise.
+ * @param array $currentfont Reference to current font array.
* @return string
* @since 3.2.000 (2008-06-23)
* @public static
*/
- public static function UTF8ToLatin1($str, $isunicode=true, &$currentfont) {
+ public static function UTF8ToLatin1($str, $isunicode, &$currentfont) {
$unicode = self::UTF8StringToArray($str, $isunicode, $currentfont); // array containing UTF-8 unicode values
return self::UTF8ArrToLatin1($unicode);
}
/**
* Converts UTF-8 strings to UTF16-BE.
- * @param $str (string) string to process.
- * @param $setbom (boolean) if true set the Byte Order Mark (BOM = 0xFEFF)
- * @param $isunicode (boolean) True when the documetn is in Unicode mode, false otherwise.
- * @param $currentfont (array) Reference to current font array.
+ * @param string $str string to process.
+ * @param boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF)
+ * @param boolean $isunicode True when the documetn is in Unicode mode, false otherwise.
+ * @param array $currentfont Reference to current font array.
* @return string
* @author Nicola Asuni
* @since 1.53.0.TC005 (2005-01-05)
* @public static
*/
- public static function UTF8ToUTF16BE($str, $setbom=false, $isunicode=true, &$currentfont) {
+ public static function UTF8ToUTF16BE($str, $setbom, $isunicode, &$currentfont) {
if (!$isunicode) {
return $str; // string is not in unicode
}
@@ -2047,50 +2049,50 @@ class TCPDF_FONTS {
/**
* Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/).
- * @param $str (string) string to manipulate.
- * @param $setbom (bool) if true set the Byte Order Mark (BOM = 0xFEFF)
- * @param $forcertl (bool) if true forces RTL text direction
- * @param $isunicode (boolean) True if the document is in Unicode mode, false otherwise.
- * @param $currentfont (array) Reference to current font array.
+ * @param string $str string to manipulate.
+ * @param bool $setbom if true set the Byte Order Mark (BOM = 0xFEFF)
+ * @param bool $forcertl if true forces RTL text direction
+ * @param boolean $isunicode True if the document is in Unicode mode, false otherwise.
+ * @param array $currentfont Reference to current font array.
* @return string
* @author Nicola Asuni
* @since 2.1.000 (2008-01-08)
* @public static
*/
- public static function utf8StrRev($str, $setbom=false, $forcertl=false, $isunicode=true, &$currentfont) {
+ public static function utf8StrRev($str, $setbom, $forcertl, $isunicode, &$currentfont) {
return self::utf8StrArrRev(self::UTF8StringToArray($str, $isunicode, $currentfont), $str, $setbom, $forcertl, $isunicode, $currentfont);
}
/**
* Reverse the RLT substrings array using the Bidirectional Algorithm (http://unicode.org/reports/tr9/).
- * @param $arr (array) array of unicode values.
- * @param $str (string) string to manipulate (or empty value).
- * @param $setbom (bool) if true set the Byte Order Mark (BOM = 0xFEFF)
- * @param $forcertl (bool) if true forces RTL text direction
- * @param $isunicode (boolean) True if the document is in Unicode mode, false otherwise.
- * @param $currentfont (array) Reference to current font array.
+ * @param array $arr array of unicode values.
+ * @param string $str string to manipulate (or empty value).
+ * @param bool $setbom if true set the Byte Order Mark (BOM = 0xFEFF)
+ * @param bool $forcertl if true forces RTL text direction
+ * @param boolean $isunicode True if the document is in Unicode mode, false otherwise.
+ * @param array $currentfont Reference to current font array.
* @return string
* @author Nicola Asuni
* @since 4.9.000 (2010-03-27)
* @public static
*/
- public static function utf8StrArrRev($arr, $str='', $setbom=false, $forcertl=false, $isunicode=true, &$currentfont) {
+ public static function utf8StrArrRev($arr, $str, $setbom, $forcertl, $isunicode, &$currentfont) {
return self::arrUTF8ToUTF16BE(self::utf8Bidi($arr, $str, $forcertl, $isunicode, $currentfont), $setbom);
}
/**
* Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/).
- * @param $ta (array) array of characters composing the string.
- * @param $str (string) string to process
- * @param $forcertl (bool) if 'R' forces RTL, if 'L' forces LTR
- * @param $isunicode (boolean) True if the document is in Unicode mode, false otherwise.
- * @param $currentfont (array) Reference to current font array.
+ * @param array $ta array of characters composing the string.
+ * @param string $str string to process
+ * @param bool $forcertl if 'R' forces RTL, if 'L' forces LTR
+ * @param boolean $isunicode True if the document is in Unicode mode, false otherwise.
+ * @param array $currentfont Reference to current font array.
* @return array of unicode chars
* @author Nicola Asuni
* @since 2.4.000 (2008-03-06)
* @public static
*/
- public static function utf8Bidi($ta, $str='', $forcertl=false, $isunicode=true, &$currentfont) {
+ public static function utf8Bidi($ta, $str, $forcertl, $isunicode, &$currentfont) {
// paragraph embedding level
$pel = 0;
// max level
diff --git a/lib/combodo/tcpdf/include/tcpdf_images.php b/lib/combodo/tcpdf/include/tcpdf_images.php
index 5e504f210..6f2860c60 100644
--- a/lib/combodo/tcpdf/include/tcpdf_images.php
+++ b/lib/combodo/tcpdf/include/tcpdf_images.php
@@ -55,6 +55,8 @@ class TCPDF_IMAGES {
* Array of hinheritable SVG properties.
* @since 5.0.000 (2010-05-02)
* @public static
+ *
+ * @var string[]
*/
public static $svginheritprop = array('clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cursor', 'direction', 'display', 'fill', 'fill-opacity', 'fill-rule', 'font', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'image-rendering', 'kerning', 'letter-spacing', 'marker', 'marker-end', 'marker-mid', 'marker-start', 'pointer-events', 'shape-rendering', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-rendering', 'visibility', 'word-spacing', 'writing-mode');
@@ -62,8 +64,8 @@ class TCPDF_IMAGES {
/**
* Return the image type given the file name or array returned by getimagesize() function.
- * @param $imgfile (string) image file name
- * @param $iminfo (array) array of image information returned by getimagesize() function.
+ * @param string $imgfile image file name
+ * @param array $iminfo array of image information returned by getimagesize() function.
* @return string image type
* @since 4.8.017 (2009-11-27)
* @public static
@@ -77,10 +79,7 @@ class TCPDF_IMAGES {
}
}
if (empty($type)) {
- $fileinfo = pathinfo($imgfile);
- if (isset($fileinfo['extension']) AND (!TCPDF_STATIC::empty_string($fileinfo['extension']))) {
- $type = strtolower(trim($fileinfo['extension']));
- }
+ $type = strtolower(trim(pathinfo(parse_url($imgfile, PHP_URL_PATH), PATHINFO_EXTENSION)));
}
if ($type == 'jpg') {
$type = 'jpeg';
@@ -90,9 +89,9 @@ class TCPDF_IMAGES {
/**
* Set the transparency for the given GD image.
- * @param $new_image (image) GD image object
- * @param $image (image) GD image object.
- * return GD image object.
+ * @param resource $new_image GD image object
+ * @param resource $image GD image object.
+ * @return resource GD image object $new_image
* @since 4.9.016 (2010-04-20)
* @public static
*/
@@ -115,8 +114,8 @@ class TCPDF_IMAGES {
/**
* Convert the loaded image to a PNG and then return a structure for the PDF creator.
* This function requires GD library and write access to the directory defined on K_PATH_CACHE constant.
- * @param $image (image) Image object.
- * @param $tempfile (string) Temporary file name.
+ * @param resource $image Image object.
+ * @param string $tempfile Temporary file name.
* return image PNG image object.
* @since 4.9.016 (2010-04-20)
* @public static
@@ -138,10 +137,10 @@ class TCPDF_IMAGES {
/**
* Convert the loaded image to a JPEG and then return a structure for the PDF creator.
* This function requires GD library and write access to the directory defined on K_PATH_CACHE constant.
- * @param $image (image) Image object.
- * @param $quality (int) JPEG quality.
- * @param $tempfile (string) Temporary file name.
- * return image JPEG image object.
+ * @param resource $image Image object.
+ * @param int $quality JPEG quality.
+ * @param string $tempfile Temporary file name.
+ * return array|false image JPEG image object.
* @public static
*/
public static function _toJPEG($image, $quality, $tempfile) {
@@ -155,8 +154,8 @@ class TCPDF_IMAGES {
/**
* Extract info from a JPEG file without using the GD library.
- * @param $file (string) image file to parse
- * @return array structure containing the image data
+ * @param string $file image file to parse
+ * @return array|false structure containing the image data
* @public static
*/
public static function _parsejpeg($file) {
@@ -234,8 +233,8 @@ class TCPDF_IMAGES {
/**
* Extract info from a PNG file without using the GD library.
- * @param $file (string) image file to parse
- * @return array structure containing the image data
+ * @param string $file image file to parse
+ * @return array|false structure containing the image data
* @public static
*/
public static function _parsepng($file) {
diff --git a/lib/combodo/tcpdf/include/tcpdf_static.php b/lib/combodo/tcpdf/include/tcpdf_static.php
index 06a1dddcc..a118d0588 100644
--- a/lib/combodo/tcpdf/include/tcpdf_static.php
+++ b/lib/combodo/tcpdf/include/tcpdf_static.php
@@ -7,7 +7,7 @@
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
-// Copyright (C) 2002-2015 Nicola Asuni - Tecnick.com LTD
+// Copyright (C) 2002-2021 Nicola Asuni - Tecnick.com LTD
//
// This file is part of TCPDF software library.
//
@@ -55,7 +55,7 @@ class TCPDF_STATIC {
* Current TCPDF version.
* @private static
*/
- private static $tcpdf_version = '6.3.5';
+ private static $tcpdf_version = '6.4.4';
/**
* String alias for total number of pages.
@@ -110,7 +110,7 @@ class TCPDF_STATIC {
/**
* Return the current TCPDF version.
- * @return TCPDF version string
+ * @return string TCPDF version string
* @since 5.9.012 (2010-11-10)
* @public static
*/
@@ -120,7 +120,7 @@ class TCPDF_STATIC {
/**
* Return the current TCPDF producer.
- * @return TCPDF producer string
+ * @return string TCPDF producer string
* @since 6.0.000 (2013-03-16)
* @public static
*/
@@ -130,7 +130,7 @@ class TCPDF_STATIC {
/**
* Sets the current active configuration setting of magic_quotes_runtime (if the set_magic_quotes_runtime function exist)
- * @param $mqr (boolean) FALSE for off, TRUE for on.
+ * @param boolean $mqr FALSE for off, TRUE for on.
* @since 4.6.025 (2009-08-17)
* @public static
*/
@@ -146,7 +146,7 @@ class TCPDF_STATIC {
/**
* Gets the current active configuration setting of magic_quotes_runtime (if the get_magic_quotes_runtime function exist)
- * @return Returns 0 if magic quotes runtime is off or get_magic_quotes_runtime doesn't exist, 1 otherwise.
+ * @return int Returns 0 if magic quotes runtime is off or get_magic_quotes_runtime doesn't exist, 1 otherwise.
* @since 4.6.025 (2009-08-17)
* @public static
*/
@@ -163,13 +163,16 @@ class TCPDF_STATIC {
/**
* Check if the URL exist.
- * @param $url (string) URL to check.
- * @return Boolean true if the URl exist, false otherwise.
+ * @param string $url URL to check.
+ * @return boolean true if the URl exist, false otherwise.
* @since 5.9.204 (2013-01-28)
* @public static
*/
public static function isValidURL($url) {
$headers = @get_headers($url);
+ if ($headers === false) {
+ return false;
+ }
return (strpos($headers[0], '200') !== false);
}
@@ -184,8 +187,8 @@ class TCPDF_STATIC {
*
UTF-8 (hex): 0xC2 0xAD (c2ad)
*
UTF-8 character: chr(194).chr(173)
*
- * @param $txt (string) input string
- * @param $unicode (boolean) True if we are in unicode mode, false otherwise.
+ * @param string $txt input string
+ * @param boolean $unicode True if we are in unicode mode, false otherwise.
* @return string without SHY characters.
* @since (4.5.019) 2009-02-28
* @public static
@@ -201,10 +204,10 @@ class TCPDF_STATIC {
/**
* Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages)
- * @param $brd (mixed) Indicates if borders must be drawn around the cell block. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
- * @param $position (string) multicell position: 'start', 'middle', 'end'
- * @param $opencell (boolean) True when the cell is left open at the page bottom, false otherwise.
- * @return border mode array
+ * @param string|array|int $brd Indicates if borders must be drawn around the cell block. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * @param string $position multicell position: 'start', 'middle', 'end'
+ * @param boolean $opencell True when the cell is left open at the page bottom, false otherwise.
+ * @return array border mode array
* @since 4.4.002 (2008-12-09)
* @public static
*/
@@ -275,8 +278,8 @@ class TCPDF_STATIC {
/**
* Determine whether a string is empty.
- * @param $str (string) string to be checked
- * @return boolean true if string is empty
+ * @param string $str string to be checked
+ * @return bool true if string is empty
* @since 4.5.044 (2009-04-16)
* @public static
*/
@@ -286,8 +289,8 @@ class TCPDF_STATIC {
/**
* Returns a temporary filename for caching object on filesystem.
- * @param $type (string) Type of file (name of the subdir on the tcpdf cache folder).
- * @param $file_id (string) TCPDF file_id.
+ * @param string $type Type of file (name of the subdir on the tcpdf cache folder).
+ * @param string $file_id TCPDF file_id.
* @return string filename.
* @since 4.5.000 (2008-12-31)
* @public static
@@ -298,7 +301,7 @@ class TCPDF_STATIC {
/**
* Add "\" before "\", "(" and ")"
- * @param $s (string) string to escape.
+ * @param string $s string to escape.
* @return string escaped string.
* @public static
*/
@@ -309,8 +312,8 @@ class TCPDF_STATIC {
/**
* Escape some special characters (< > &) for XML output.
- * @param $str (string) Input string to convert.
- * @return converted string
+ * @param string $str Input string to convert.
+ * @return string converted string
* @since 5.9.121 (2011-09-28)
* @public static
*/
@@ -322,8 +325,8 @@ class TCPDF_STATIC {
/**
* Creates a copy of a class object
- * @param $object (object) class object to be cloned
- * @return cloned object
+ * @param object $object class object to be cloned
+ * @return object cloned object
* @since 4.5.029 (2009-03-19)
* @public static
*/
@@ -337,8 +340,8 @@ class TCPDF_STATIC {
/**
* Output input data and compress it if possible.
- * @param $data (string) Data to output.
- * @param $length (int) Data length in bytes.
+ * @param string $data Data to output.
+ * @param int $length Data length in bytes.
* @since 5.9.086
* @public static
*/
@@ -352,10 +355,10 @@ class TCPDF_STATIC {
/**
* Replace page number aliases with number.
- * @param $page (string) Page content.
- * @param $replace (array) Array of replacements (array keys are replacement strings, values are alias arrays).
- * @param $diff (int) If passed, this will be set to the total char number difference between alias and replacements.
- * @return replaced page content and updated $diff parameter as array.
+ * @param string $page Page content.
+ * @param array $replace Array of replacements (array keys are replacement strings, values are alias arrays).
+ * @param int $diff If passed, this will be set to the total char number difference between alias and replacements.
+ * @return array replaced page content and updated $diff parameter as array.
* @public static
*/
public static function replacePageNumAliases($page, $replace, $diff=0) {
@@ -372,7 +375,7 @@ class TCPDF_STATIC {
/**
* Returns timestamp in seconds from formatted date-time.
- * @param $date (string) Formatted date-time.
+ * @param string $date Formatted date-time.
* @return int seconds.
* @since 5.9.152 (2012-03-23)
* @public static
@@ -387,7 +390,7 @@ class TCPDF_STATIC {
/**
* Returns a formatted date-time.
- * @param $time (int) Time in seconds.
+ * @param int $time Time in seconds.
* @return string escaped date string.
* @since 5.9.152 (2012-03-23)
* @public static
@@ -398,7 +401,7 @@ class TCPDF_STATIC {
/**
* Returns a string containing random data to be used as a seed for encryption methods.
- * @param $seed (string) starting seed value
+ * @param string $seed starting seed value
* @return string containing random data
* @author Nicola Asuni
* @since 5.9.006 (2010-10-19)
@@ -422,8 +425,8 @@ class TCPDF_STATIC {
/**
* Encrypts a string using MD5 and returns it's value as a binary string.
- * @param $str (string) input string
- * @return String MD5 encrypted binary string
+ * @param string $str input string
+ * @return string MD5 encrypted binary string
* @since 2.0.000 (2008-01-02)
* @public static
*/
@@ -432,11 +435,11 @@ class TCPDF_STATIC {
}
/**
- * Returns the input text exrypted using AES algorithm and the specified key.
+ * Returns the input text encrypted using AES algorithm and the specified key.
* This method requires openssl or mcrypt. Text is padded to 16bytes blocks
- * @param $key (string) encryption key
- * @param $text (String) input text to be encrypted
- * @return String encrypted text
+ * @param string $key encryption key
+ * @param string $text input text to be encrypted
+ * @return string encrypted text
* @author Nicola Asuni
* @since 5.0.005 (2010-05-11)
* @public static
@@ -446,8 +449,12 @@ class TCPDF_STATIC {
$padding = 16 - (strlen($text) % 16);
$text .= str_repeat(chr($padding), $padding);
if (extension_loaded('openssl')) {
- $iv = openssl_random_pseudo_bytes (openssl_cipher_iv_length('aes-256-cbc'));
- $text = openssl_encrypt($text, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv);
+ $algo = 'aes-256-cbc';
+ if (strlen($key) == 16) {
+ $algo = 'aes-128-cbc';
+ }
+ $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($algo));
+ $text = openssl_encrypt($text, $algo, $key, OPENSSL_RAW_DATA, $iv);
return $iv.substr($text, 0, -16);
}
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND);
@@ -457,19 +464,23 @@ class TCPDF_STATIC {
}
/**
- * Returns the input text exrypted using AES algorithm and the specified key.
+ * Returns the input text encrypted using AES algorithm and the specified key.
* This method requires openssl or mcrypt. Text is not padded
- * @param $key (string) encryption key
- * @param $text (String) input text to be encrypted
- * @return String encrypted text
+ * @param string $key encryption key
+ * @param string $text input text to be encrypted
+ * @return string encrypted text
* @author Nicola Asuni
* @since TODO
* @public static
*/
public static function _AESnopad($key, $text) {
if (extension_loaded('openssl')) {
- $iv = str_repeat("\x00", openssl_cipher_iv_length('aes-256-cbc'));
- $text = openssl_encrypt($text, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv);
+ $algo = 'aes-256-cbc';
+ if (strlen($key) == 16) {
+ $algo = 'aes-128-cbc';
+ }
+ $iv = str_repeat("\x00", openssl_cipher_iv_length($algo));
+ $text = openssl_encrypt($text, $algo, $key, OPENSSL_RAW_DATA, $iv);
return substr($text, 0, -16);
}
$iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC));
@@ -480,11 +491,11 @@ class TCPDF_STATIC {
/**
* Returns the input text encrypted using RC4 algorithm and the specified key.
* RC4 is the standard encryption algorithm used in PDF format
- * @param $key (string) Encryption key.
- * @param $text (String) Input text to be encrypted.
- * @param $last_enc_key (String) Reference to last RC4 key encrypted.
- * @param $last_enc_key_c (String) Reference to last RC4 computed key.
- * @return String encrypted text
+ * @param string $key Encryption key.
+ * @param string $text Input text to be encrypted.
+ * @param string $last_enc_key Reference to last RC4 key encrypted.
+ * @param string $last_enc_key_c Reference to last RC4 computed key.
+ * @return string encrypted text
* @since 2.0.000 (2008-01-02)
* @author Klemen Vodopivec, Nicola Asuni
* @public static
@@ -495,7 +506,7 @@ class TCPDF_STATIC {
return $out;
}
if ($last_enc_key != $key) {
- $k = str_repeat($key, ((256 / strlen($key)) + 1));
+ $k = str_repeat($key, (int) ((256 / strlen($key)) + 1));
$rc4 = range(0, 255);
$j = 0;
for ($i = 0; $i < 256; ++$i) {
@@ -527,8 +538,8 @@ class TCPDF_STATIC {
/**
* Return the permission code used on encryption (P value).
- * @param $permissions (Array) the set of permissions (specify the ones you want to block).
- * @param $mode (int) encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit.
+ * @param array $permissions the set of permissions (specify the ones you want to block).
+ * @param int $mode encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit.
* @since 5.0.005 (2010-05-12)
* @author Nicola Asuni
* @public static
@@ -564,8 +575,8 @@ class TCPDF_STATIC {
/**
* Convert hexadecimal string to string
- * @param $bs (string) byte-string to convert
- * @return String
+ * @param string $bs byte-string to convert
+ * @return string
* @since 5.0.005 (2010-05-12)
* @author Nicola Asuni
* @public static
@@ -586,8 +597,8 @@ class TCPDF_STATIC {
/**
* Convert string to hexadecimal string (byte string)
- * @param $s (string) string to convert
- * @return byte string
+ * @param string $s string to convert
+ * @return string byte string
* @since 5.0.010 (2010-05-17)
* @author Nicola Asuni
* @public static
@@ -603,8 +614,8 @@ class TCPDF_STATIC {
/**
* Convert encryption P value to a string of bytes, low-order byte first.
- * @param $protection (string) 32bit encryption permission value (P value)
- * @return String
+ * @param string $protection 32bit encryption permission value (P value)
+ * @return string
* @since 5.0.005 (2010-05-12)
* @author Nicola Asuni
* @public static
@@ -620,8 +631,8 @@ class TCPDF_STATIC {
/**
* Encode a name object.
- * @param $name (string) Name object to encode.
- * @return (string) Encoded name object.
+ * @param string $name Name object to encode.
+ * @return string Encoded name object.
* @author Nicola Asuni
* @since 5.9.097 (2011-06-23)
* @public static
@@ -642,9 +653,9 @@ class TCPDF_STATIC {
/**
* Convert JavaScript form fields properties array to Annotation Properties array.
- * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
- * @param $spot_colors (array) Reference to spot colors array.
- * @param $rtl (boolean) True if in Right-To-Left text direction mode, false otherwise.
+ * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
+ * @param array $spot_colors Reference to spot colors array.
+ * @param boolean $rtl True if in Right-To-Left text direction mode, false otherwise.
* @return array of annotation properties
* @author Nicola Asuni
* @since 4.8.000 (2009-09-06)
@@ -652,7 +663,7 @@ class TCPDF_STATIC {
*/
public static function getAnnotOptFromJSProp($prop, &$spot_colors, $rtl=false) {
if (isset($prop['aopt']) AND is_array($prop['aopt'])) {
- // the annotation options area lready defined
+ // the annotation options are already defined
return $prop['aopt'];
}
$opt = array(); // value to be returned
@@ -1011,8 +1022,9 @@ class TCPDF_STATIC {
/**
* Format the page numbers.
- * This method can be overriden for custom formats.
- * @param $num (int) page number
+ * This method can be overridden for custom formats.
+ * @param int $num page number
+ * @return string
* @since 4.2.005 (2008-11-06)
* @public static
*/
@@ -1022,8 +1034,9 @@ class TCPDF_STATIC {
/**
* Format the page numbers on the Table Of Content.
- * This method can be overriden for custom formats.
- * @param $num (int) page number
+ * This method can be overridden for custom formats.
+ * @param int $num page number
+ * @return string
* @since 4.5.001 (2009-01-04)
* @see addTOC(), addHTMLTOC()
* @public static
@@ -1034,8 +1047,8 @@ class TCPDF_STATIC {
/**
* Extracts the CSS properties from a CSS string.
- * @param $cssdata (string) string containing CSS definitions.
- * @return An array where the keys are the CSS selectors and the values are the CSS properties.
+ * @param string $cssdata string containing CSS definitions.
+ * @return array An array where the keys are the CSS selectors and the values are the CSS properties.
* @author Nicola Asuni
* @since 5.1.000 (2010-05-25)
* @public static
@@ -1125,20 +1138,20 @@ class TCPDF_STATIC {
/**
* Cleanup HTML code (requires HTML Tidy library).
- * @param $html (string) htmlcode to fix
- * @param $default_css (string) CSS commands to add
- * @param $tagvs (array) parameters for setHtmlVSpace method
- * @param $tidy_options (array) options for tidy_parse_string function
- * @param $tagvspaces (array) Array of vertical spaces for tags.
+ * @param string $html htmlcode to fix
+ * @param string $default_css CSS commands to add
+ * @param array|null $tagvs parameters for setHtmlVSpace method
+ * @param array|null $tidy_options options for tidy_parse_string function
+ * @param array $tagvspaces Array of vertical spaces for tags.
* @return string XHTML code cleaned up
* @author Nicola Asuni
* @since 5.9.017 (2010-11-16)
* @see setHtmlVSpace()
* @public static
*/
- public static function fixHTMLCode($html, $default_css='', $tagvs='', $tidy_options='', &$tagvspaces) {
+ public static function fixHTMLCode($html, $default_css, $tagvs, $tidy_options, &$tagvspaces) {
// configure parameters for HTML Tidy
- if ($tidy_options === '') {
+ if (TCPDF_STATIC::empty_string($tidy_options)) {
$tidy_options = array (
'clean' => 1,
'drop-empty-paras' => 0,
@@ -1185,7 +1198,7 @@ class TCPDF_STATIC {
// remove some empty tag blocks
$html = preg_replace('/
]*)><\/p>/', '', $html);
- if ($tagvs !== '') {
+ if (!TCPDF_STATIC::empty_string($tagvs)) {
// set vertical space for some XHTML tags
$tagvspaces = $tagvs;
}
@@ -1195,9 +1208,9 @@ class TCPDF_STATIC {
/**
* Returns true if the CSS selector is valid for the selected HTML tag
- * @param $dom (array) array of HTML tags and properties
- * @param $key (int) key of the current HTML tag
- * @param $selector (string) CSS selector string
+ * @param array $dom array of HTML tags and properties
+ * @param int $key key of the current HTML tag
+ * @param string $selector CSS selector string
* @return true if the selector is valid, false otherwise
* @since 5.1.000 (2010-05-25)
* @public static
@@ -1355,9 +1368,9 @@ class TCPDF_STATIC {
/**
* Returns the styles array that apply for the selected HTML tag.
- * @param $dom (array) array of HTML tags and properties
- * @param $key (int) key of the current HTML tag
- * @param $css (array) array of CSS properties
+ * @param array $dom array of HTML tags and properties
+ * @param int $key key of the current HTML tag
+ * @param array $css array of CSS properties
* @return array containing CSS properties
* @since 5.1.000 (2010-05-25)
* @public static
@@ -1402,7 +1415,7 @@ class TCPDF_STATIC {
/**
* Compact CSS data array into single string.
- * @param $css (array) array of CSS properties
+ * @param array $css array of CSS properties
* @return string containing merged CSS properties
* @since 5.9.070 (2011-04-19)
* @public static
@@ -1433,13 +1446,17 @@ class TCPDF_STATIC {
/**
* Returns the Roman representation of an integer number
- * @param $number (int) number to convert
+ * @param int $number number to convert
* @return string roman representation of the specified number
* @since 4.4.004 (2008-12-10)
* @public static
*/
public static function intToRoman($number) {
$roman = '';
+ if ($number >= 4000) {
+ // do not represent numbers above 4000 in Roman numerals
+ return strval($number);
+ }
while ($number >= 1000) {
$roman .= 'M';
$number -= 1000;
@@ -1497,10 +1514,10 @@ class TCPDF_STATIC {
/**
* Find position of last occurrence of a substring in a string
- * @param $haystack (string) The string to search in.
- * @param $needle (string) substring to search.
- * @param $offset (int) May be specified to begin searching an arbitrary number of characters into the string.
- * @return Returns the position where the needle exists. Returns FALSE if the needle was not found.
+ * @param string $haystack The string to search in.
+ * @param string $needle substring to search.
+ * @param int $offset May be specified to begin searching an arbitrary number of characters into the string.
+ * @return int|false Returns the position where the needle exists. Returns FALSE if the needle was not found.
* @since 4.8.038 (2010-03-13)
* @public static
*/
@@ -1513,7 +1530,7 @@ class TCPDF_STATIC {
/**
* Returns an array of hyphenation patterns.
- * @param $file (string) TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
+ * @param string $file TEX file containing hypenation patterns. TEX patterns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
* @return array of hyphenation patterns
* @author Nicola Asuni
* @since 4.9.012 (2010-04-12)
@@ -1546,7 +1563,7 @@ class TCPDF_STATIC {
/**
* Get the Path-Painting Operators.
- * @param $style (string) Style of rendering. Possible values are:
+ * @param string $style Style of rendering. Possible values are:
*
*
S or D: Stroke the path.
*
s or d: Close and stroke the path.
@@ -1560,7 +1577,8 @@ class TCPDF_STATIC {
*
CEO: Clipping mode using the nonzero winding number rule to determine which regions lie inside the clipping path
*
n: End the path object without filling or stroking it.
*
- * @param $default (string) default style
+ * @param string $default default style
+ * @return string
* @author Nicola Asuni
* @since 5.0.000 (2010-04-30)
* @public static
@@ -1637,9 +1655,9 @@ class TCPDF_STATIC {
/**
* Get the product of two SVG tranformation matrices
- * @param $ta (array) first SVG tranformation matrix
- * @param $tb (array) second SVG tranformation matrix
- * @return transformation array
+ * @param array $ta first SVG tranformation matrix
+ * @param array $tb second SVG tranformation matrix
+ * @return array transformation array
* @author Nicola Asuni
* @since 5.0.000 (2010-05-02)
* @public static
@@ -1657,7 +1675,7 @@ class TCPDF_STATIC {
/**
* Get the tranformation matrix from SVG transform attribute
- * @param $attribute (string) transformation
+ * @param string $attribute transformation
* @return array of transformations
* @author Nicola Asuni
* @since 5.0.000 (2010-05-02)
@@ -1752,10 +1770,10 @@ class TCPDF_STATIC {
/**
* Returns the angle in radiants between two vectors
- * @param $x1 (int) X coordinate of first vector point
- * @param $y1 (int) Y coordinate of first vector point
- * @param $x2 (int) X coordinate of second vector point
- * @param $y2 (int) Y coordinate of second vector point
+ * @param int $x1 X coordinate of first vector point
+ * @param int $y1 Y coordinate of first vector point
+ * @param int $x2 X coordinate of second vector point
+ * @param int $y2 Y coordinate of second vector point
* @author Nicola Asuni
* @since 5.0.000 (2010-05-04)
* @public static
@@ -1777,17 +1795,20 @@ class TCPDF_STATIC {
/**
* Split string by a regular expression.
* This is a wrapper for the preg_split function to avoid the bug: https://bugs.php.net/bug.php?id=45850
- * @param $pattern (string) The regular expression pattern to search for without the modifiers, as a string.
- * @param $modifiers (string) The modifiers part of the pattern,
- * @param $subject (string) The input string.
- * @param $limit (int) If specified, then only substrings up to limit are returned with the rest of the string being placed in the last substring. A limit of -1, 0 or NULL means "no limit" and, as is standard across PHP, you can use NULL to skip to the flags parameter.
- * @param $flags (int) The flags as specified on the preg_split PHP function.
- * @return Returns an array containing substrings of subject split along boundaries matched by pattern.modifier
+ * @param string $pattern The regular expression pattern to search for without the modifiers, as a string.
+ * @param string $modifiers The modifiers part of the pattern,
+ * @param string $subject The input string.
+ * @param int $limit If specified, then only substrings up to limit are returned with the rest of the string being placed in the last substring. A limit of -1, 0 or NULL means "no limit" and, as is standard across PHP, you can use NULL to skip to the flags parameter.
+ * @param int $flags The flags as specified on the preg_split PHP function.
+ * @return array Returns an array containing substrings of subject split along boundaries matched by pattern.modifier
* @author Nicola Asuni
* @since 6.0.023
* @public static
*/
public static function pregSplit($pattern, $modifiers, $subject, $limit=NULL, $flags=NULL) {
+ // PHP 8.1 deprecates nulls for $limit and $flags
+ $limit = $limit === null ? -1 : $limit;
+ $flags = $flags === null ? 0 : $flags;
// the bug only happens on PHP 5.2 when using the u modifier
if ((strpos($modifiers, 'u') === FALSE) OR (count(preg_split('//u', "\n\t", -1, PREG_SPLIT_NO_EMPTY)) == 2)) {
return preg_split($pattern.$modifiers, $subject, $limit, $flags);
@@ -1807,9 +1828,9 @@ class TCPDF_STATIC {
/**
* Wrapper to use fopen only with local files
- * @param filename (string) Name of the file to open
- * @param $mode (string)
- * @return Returns a file pointer resource on success, or FALSE on error.
+ * @param string $filename Name of the file to open
+ * @param string $mode
+ * @return resource|false Returns a file pointer resource on success, or FALSE on error.
* @public static
*/
public static function fopenLocal($filename, $mode) {
@@ -1823,9 +1844,10 @@ class TCPDF_STATIC {
/**
* Check if the URL exist.
- * @param url (string) URL to check.
- * @return Returns TRUE if the URL exists; FALSE otherwise.
+ * @param string $url URL to check.
+ * @return bool Returns TRUE if the URL exists; FALSE otherwise.
* @public static
+ * @since 6.2.25
*/
public static function url_exists($url) {
$crs = curl_init();
@@ -1842,6 +1864,10 @@ class TCPDF_STATIC {
curl_setopt($crs, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($crs, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($crs, CURLOPT_USERAGENT, 'tc-lib-file');
+ curl_setopt($crs, CURLOPT_MAXREDIRS, 5);
+ if (defined('CURLOPT_PROTOCOLS')) {
+ curl_setopt($crs, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP | CURLPROTO_FTP | CURLPROTO_FTPS);
+ }
curl_exec($crs);
$code = curl_getinfo($crs, CURLINFO_HTTP_CODE);
curl_close($crs);
@@ -1872,8 +1898,8 @@ class TCPDF_STATIC {
* Wrapper for file_exists.
* Checks whether a file or directory exists.
* Only allows some protocols and local files.
- * @param filename (string) Path to the file or directory.
- * @return Returns TRUE if the file or directory specified by filename exists; FALSE otherwise.
+ * @param string $filename Path to the file or directory.
+ * @return bool Returns TRUE if the file or directory specified by filename exists; FALSE otherwise.
* @public static
*/
public static function file_exists($filename) {
@@ -1889,8 +1915,8 @@ class TCPDF_STATIC {
/**
* Reads entire file into a string.
* The file can be also an URL.
- * @param $file (string) Name of the file or URL to read.
- * @return The function returns the read data or FALSE on failure.
+ * @param string $file Name of the file or URL to read.
+ * @return string|false The function returns the read data or FALSE on failure.
* @author Nicola Asuni
* @since 6.0.025
* @public static
@@ -1973,6 +1999,10 @@ class TCPDF_STATIC {
curl_setopt($crs, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($crs, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($crs, CURLOPT_USERAGENT, 'tc-lib-file');
+ curl_setopt($crs, CURLOPT_MAXREDIRS, 5);
+ if (defined('CURLOPT_PROTOCOLS')) {
+ curl_setopt($crs, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP | CURLPROTO_FTP | CURLPROTO_FTPS);
+ }
$ret = curl_exec($crs);
curl_close($crs);
if ($ret !== false) {
@@ -1985,8 +2015,8 @@ class TCPDF_STATIC {
/**
* Get ULONG from string (Big Endian 32-bit unsigned integer).
- * @param $str (string) string from where to extract value
- * @param $offset (int) point from where to read the data
+ * @param string $str string from where to extract value
+ * @param int $offset point from where to read the data
* @return int 32 bit value
* @author Nicola Asuni
* @since 5.2.000 (2010-06-02)
@@ -1999,8 +2029,8 @@ class TCPDF_STATIC {
/**
* Get USHORT from string (Big Endian 16-bit unsigned integer).
- * @param $str (string) string from where to extract value
- * @param $offset (int) point from where to read the data
+ * @param string $str string from where to extract value
+ * @param int $offset point from where to read the data
* @return int 16 bit value
* @author Nicola Asuni
* @since 5.2.000 (2010-06-02)
@@ -2013,8 +2043,8 @@ class TCPDF_STATIC {
/**
* Get SHORT from string (Big Endian 16-bit signed integer).
- * @param $str (string) String from where to extract value.
- * @param $offset (int) Point from where to read the data.
+ * @param string $str String from where to extract value.
+ * @param int $offset Point from where to read the data.
* @return int 16 bit value
* @author Nicola Asuni
* @since 5.2.000 (2010-06-02)
@@ -2027,8 +2057,8 @@ class TCPDF_STATIC {
/**
* Get FWORD from string (Big Endian 16-bit signed integer).
- * @param $str (string) String from where to extract value.
- * @param $offset (int) Point from where to read the data.
+ * @param string $str String from where to extract value.
+ * @param int $offset Point from where to read the data.
* @return int 16 bit value
* @author Nicola Asuni
* @since 5.9.123 (2011-09-30)
@@ -2044,8 +2074,8 @@ class TCPDF_STATIC {
/**
* Get UFWORD from string (Big Endian 16-bit unsigned integer).
- * @param $str (string) string from where to extract value
- * @param $offset (int) point from where to read the data
+ * @param string $str string from where to extract value
+ * @param int $offset point from where to read the data
* @return int 16 bit value
* @author Nicola Asuni
* @since 5.9.123 (2011-09-30)
@@ -2058,8 +2088,8 @@ class TCPDF_STATIC {
/**
* Get FIXED from string (32-bit signed fixed-point number (16.16).
- * @param $str (string) string from where to extract value
- * @param $offset (int) point from where to read the data
+ * @param string $str string from where to extract value
+ * @param int $offset point from where to read the data
* @return int 16 bit value
* @author Nicola Asuni
* @since 5.9.123 (2011-09-30)
@@ -2076,8 +2106,8 @@ class TCPDF_STATIC {
/**
* Get BYTE from string (8-bit unsigned integer).
- * @param $str (string) String from where to extract value.
- * @param $offset (int) Point from where to read the data.
+ * @param string $str String from where to extract value.
+ * @param int $offset Point from where to read the data.
* @return int 8 bit value
* @author Nicola Asuni
* @since 5.2.000 (2010-06-02)
@@ -2090,9 +2120,9 @@ class TCPDF_STATIC {
/**
* Binary-safe and URL-safe file read.
* Reads up to length bytes from the file pointer referenced by handle. Reading stops as soon as one of the following conditions is met: length bytes have been read; EOF (end of file) is reached.
- * @param $handle (resource)
- * @param $length (int)
- * @return Returns the read string or FALSE in case of error.
+ * @param resource $handle
+ * @param int $length
+ * @return string|false Returns the read string or FALSE in case of error.
* @author Nicola Asuni
* @since 4.5.027 (2009-03-16)
* @public static
@@ -2111,8 +2141,8 @@ class TCPDF_STATIC {
/**
* Read a 4-byte (32 bit) integer from file.
- * @param $f (string) file name.
- * @return 4-byte integer
+ * @param resource $f file resource.
+ * @return int 4-byte integer
* @public static
*/
public static function _freadint($f) {
@@ -2120,11 +2150,12 @@ class TCPDF_STATIC {
return $a['i'];
}
-
/**
* Array of page formats
* measures are calculated in this way: (inches * 72) or (millimeters * 72 / 25.4)
* @public static
+ *
+ * @var array
*/
public static $page_formats = array(
// ISO 216 A Series + 2 SIS 014711 extensions
@@ -2480,7 +2511,7 @@ class TCPDF_STATIC {
/**
* Get page dimensions from format name.
- * @param $format (mixed) The format name @see self::$page_format
+ * @param mixed $format The format name @see self::$page_format
* @return array containing page width and height in points
* @since 5.0.010 (2010-05-17)
* @public static
@@ -2494,20 +2525,20 @@ class TCPDF_STATIC {
/**
* Set page boundaries.
- * @param $page (int) page number
- * @param $type (string) valid values are:
'MediaBox' : the boundaries of the physical medium on which the page shall be displayed or printed;
'CropBox' : the visible region of default user space;
'BleedBox' : the region to which the contents of the page shall be clipped when output in a production environment;
'TrimBox' : the intended dimensions of the finished page after trimming;
'ArtBox' : the page's meaningful content (including potential white space).
- * @param $llx (float) lower-left x coordinate in user units.
- * @param $lly (float) lower-left y coordinate in user units.
- * @param $urx (float) upper-right x coordinate in user units.
- * @param $ury (float) upper-right y coordinate in user units.
- * @param $points (boolean) If true uses user units as unit of measure, otherwise uses PDF points.
- * @param $k (float) Scale factor (number of points in user unit).
- * @param $pagedim (array) Array of page dimensions.
- * @return pagedim array of page dimensions.
+ * @param int $page page number
+ * @param string $type valid values are:
'MediaBox' : the boundaries of the physical medium on which the page shall be displayed or printed;
'CropBox' : the visible region of default user space;
'BleedBox' : the region to which the contents of the page shall be clipped when output in a production environment;
'TrimBox' : the intended dimensions of the finished page after trimming;
'ArtBox' : the page's meaningful content (including potential white space).
+ * @param float $llx lower-left x coordinate in user units.
+ * @param float $lly lower-left y coordinate in user units.
+ * @param float $urx upper-right x coordinate in user units.
+ * @param float $ury upper-right y coordinate in user units.
+ * @param boolean $points If true uses user units as unit of measure, otherwise uses PDF points.
+ * @param float $k Scale factor (number of points in user unit).
+ * @param array $pagedim Array of page dimensions.
+ * @return array pagedim array of page dimensions.
* @since 5.0.010 (2010-05-17)
* @public static
*/
- public static function setPageBoxes($page, $type, $llx, $lly, $urx, $ury, $points=false, $k, $pagedim=array()) {
+ public static function setPageBoxes($page, $type, $llx, $lly, $urx, $ury, $points, $k, $pagedim=array()) {
if (!isset($pagedim[$page])) {
// initialize array
$pagedim[$page] = array();
@@ -2527,9 +2558,9 @@ class TCPDF_STATIC {
/**
* Swap X and Y coordinates of page boxes (change page boxes orientation).
- * @param $page (int) page number
- * @param $pagedim (array) Array of page dimensions.
- * @return pagedim array of page dimensions.
+ * @param int $page page number
+ * @param array $pagedim Array of page dimensions.
+ * @return array pagedim array of page dimensions.
* @since 5.0.010 (2010-05-17)
* @public static
*/
@@ -2550,8 +2581,8 @@ class TCPDF_STATIC {
/**
* Get the canonical page layout mode.
- * @param $layout (string) The page layout. Possible values are:
SinglePage Display one page at a time
OneColumn Display the pages in one column
TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left
TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right
TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right
- * @return (string) Canonical page layout name.
+ * @param string $layout The page layout. Possible values are:
SinglePage Display one page at a time
OneColumn Display the pages in one column
TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left
TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right
TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right
+ * @return string Canonical page layout name.
* @public static
*/
public static function getPageLayoutMode($layout='SinglePage') {
@@ -2593,8 +2624,8 @@ class TCPDF_STATIC {
/**
* Get the canonical page layout mode.
- * @param $mode (string) A name object specifying how the document should be displayed when opened:
UseNone Neither document outline nor thumbnail images visible
UseOutlines Document outline visible
UseThumbs Thumbnail images visible
FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible
UseOC (PDF 1.5) Optional content group panel visible
+ * @return string Canonical page mode name.
* @public static
*/
public static function getPageMode($mode='UseNone') {
diff --git a/lib/combodo/tcpdf/tcpdf.php b/lib/combodo/tcpdf/tcpdf.php
index a71afc3a8..400434730 100644
--- a/lib/combodo/tcpdf/tcpdf.php
+++ b/lib/combodo/tcpdf/tcpdf.php
@@ -1,13 +1,13 @@
+ * @phpstan-var array{0: string, 1: string, 2: float|null}
*/
protected $header_font;
/**
* Default font used on page footer.
* @protected
+ * @var array
+ * @phpstan-var array{0: string, 1: string, 2: float|null}
*/
protected $footer_font;
@@ -652,7 +656,7 @@ class TCPDF {
protected $header_title = '';
/**
- * String to pring on page header after title.
+ * String to print on page header after title.
* @protected
*/
protected $header_string = '';
@@ -661,6 +665,8 @@ class TCPDF {
* Color for header text (RGB array).
* @since 5.9.174 (2012-07-25)
* @protected
+ * @var int[]
+ * @phpstan-var array{0: int, 1: int, 2: int}
*/
protected $header_text_color = array(0,0,0);
@@ -668,6 +674,8 @@ class TCPDF {
* Color for header line (RGB array).
* @since 5.9.174 (2012-07-25)
* @protected
+ * @var int[]
+ * @phpstan-var array{0: int, 1: int, 2: int}
*/
protected $header_line_color = array(0,0,0);
@@ -675,6 +683,8 @@ class TCPDF {
* Color for footer text (RGB array).
* @since 5.9.174 (2012-07-25)
* @protected
+ * @var int[]
+ * @phpstan-var array{0: int, 1: int, 2: int}
*/
protected $footer_text_color = array(0,0,0);
@@ -682,6 +692,8 @@ class TCPDF {
* Color for footer line (RGB array).
* @since 5.9.174 (2012-07-25)
* @protected
+ * @var int[]
+ * @phpstan-var array{0: int, 1: int, 2: int}
*/
protected $footer_line_color = array(0,0,0);
@@ -773,13 +785,6 @@ class TCPDF {
*/
protected $encoding = 'UTF-8';
- /**
- * PHP internal encoding.
- * @protected
- * @since 1.53.0.TC016
- */
- protected $internal_encoding;
-
/**
* Boolean flag to indicate if the document language is Right-To-Left.
* @protected
@@ -923,6 +928,7 @@ class TCPDF {
* Default cell height ratio.
* @protected
* @since 3.0.014 (2008-05-23)
+ * @var float
*/
protected $cell_height_ratio = K_CELL_HEIGHT_RATIO;
@@ -1800,6 +1806,7 @@ class TCPDF {
* (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).
* @protected
* @since 5.9.152 (2012-03-23)
+ * @var array
*/
protected $overprint = array('OP' => false, 'op' => false, 'OPM' => 0);
@@ -1832,6 +1839,23 @@ class TCPDF {
*/
protected $gdgammacache = array();
+ /**
+ * Cache array for file content
+ * @protected
+ * @var array
+ * @since 6.3.5 (2020-09-28)
+ */
+ protected $fileContentCache = array();
+
+ /**
+ * Whether to allow local file path in image html tags, when prefixed with file://
+ *
+ * @var bool
+ * @protected
+ * @since 6.4 (2020-07-23)
+ */
+ protected $allowLocalFiles = false;
+
//------------------------------------------------------------
// METHODS
//------------------------------------------------------------
@@ -1840,24 +1864,17 @@ class TCPDF {
* This is the class constructor.
* It allows to set up the page format, the orientation and the measure unit used in all the methods (except for the font sizes).
*
- * IMPORTANT: Please note that this method sets the mb_internal_encoding to ASCII, so if you are using the mbstring module functions with TCPDF you need to correctly set/unset the mb_internal_encoding when needed.
- *
- * @param $orientation (string) page orientation. Possible values are (case insensitive):
P or Portrait (default)
L or Landscape
'' (empty string) for automatic orientation
- * @param $unit (string) User measure unit. Possible values are:
pt: point
mm: millimeter (default)
cm: centimeter
in: inch
A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit.
- * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().
- * @param $unicode (boolean) TRUE means that the input text is unicode (default = true)
- * @param $encoding (string) Charset encoding (used only when converting back html entities); default is UTF-8.
- * @param $diskcache (boolean) DEPRECATED FEATURE
- * @param $pdfa (integer) If not false, set the document to PDF/A mode and the good version (1 or 3).
+ * @param string $orientation page orientation. Possible values are (case insensitive):
P or Portrait (default)
L or Landscape
'' (empty string) for automatic orientation
+ * @param string $unit User measure unit. Possible values are:
pt: point
mm: millimeter (default)
cm: centimeter
in: inch
A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit.
+ * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().
+ * @param boolean $unicode TRUE means that the input text is unicode (default = true)
+ * @param string $encoding Charset encoding (used only when converting back html entities); default is UTF-8.
+ * @param boolean $diskcache DEPRECATED FEATURE
+ * @param false|integer $pdfa If not false, set the document to PDF/A mode and the good version (1 or 3).
* @public
* @see getPageSizeFromFormat(), setPageFormat()
*/
public function __construct($orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8', $diskcache=false, $pdfa=false) {
- /* Set internal character encoding to ASCII */
- if (function_exists('mb_internal_encoding') AND mb_internal_encoding()) {
- $this->internal_encoding = mb_internal_encoding();
- mb_internal_encoding('ASCII');
- }
// set file ID for trailer
$serformat = (is_array($format) ? json_encode($format) : $format);
$this->file_id = md5(TCPDF_STATIC::getRandomSeed('TCPDF'.$orientation.$unit.$serformat.$encoding));
@@ -1932,7 +1949,7 @@ class TCPDF {
$this->setPageFormat($format, $orientation);
// page margins (1 cm)
$margin = 28.35 / $this->k;
- $this->SetMargins($margin, $margin);
+ $this->setMargins($margin, $margin);
$this->clMargin = $this->lMargin;
$this->crMargin = $this->rMargin;
// internal cell padding
@@ -1947,11 +1964,11 @@ class TCPDF {
$this->linestyleJoin = '0 j';
$this->linestyleDash = '[] 0 d';
// automatic page break
- $this->SetAutoPageBreak(true, (2 * $margin));
+ $this->setAutoPageBreak(true, (2 * $margin));
// full width display mode
- $this->SetDisplayMode('fullwidth');
+ $this->setDisplayMode('fullwidth');
// compression
- $this->SetCompression();
+ $this->setCompression();
// set default PDF version number
$this->setPDFVersion();
$this->tcpdflink = true;
@@ -1982,7 +1999,7 @@ class TCPDF {
// initialize some settings
TCPDF_FONTS::utf8Bidi(array(), '', false, $this->isunicode, $this->CurrentFont);
// set default font
- $this->SetFont($this->FontFamily, $this->FontStyle, $this->FontSizePt);
+ $this->setFont($this->FontFamily, $this->FontStyle, $this->FontSizePt);
$this->setHeaderFont(array($this->FontFamily, $this->FontStyle, $this->FontSizePt));
$this->setFooterFont(array($this->FontFamily, $this->FontStyle, $this->FontSizePt));
// check if PCRE Unicode support is enabled
@@ -2024,7 +2041,7 @@ class TCPDF {
/**
* Set the units of measure for the document.
- * @param $unit (string) User measure unit. Possible values are:
pt: point
mm: millimeter (default)
cm: centimeter
in: inch
A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit.
+ * @param string $unit User measure unit. Possible values are:
pt: point
mm: millimeter (default)
cm: centimeter
in: inch
A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit.
* @public
* @since 3.0.015 (2008-06-06)
*/
@@ -2067,7 +2084,7 @@ class TCPDF {
/**
* Change the format of the current page
- * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() documentation or an array of two numbers (width, height) or an array containing the following measures and options:
+ * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() documentation or an array of two numbers (width, height) or an array containing the following measures and options:
*
['format'] = page format name (one of the above);
*
['Rotate'] : The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.
*
['PZ'] : The page's preferred zoom (magnification) factor.
@@ -2111,7 +2128,7 @@ class TCPDF {
*
['trans']['SS'] : (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.
*
['trans']['B'] : (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.
*
- * @param $orientation (string) page orientation. Possible values are (case insensitive):
+ * @param string $orientation page orientation. Possible values are (case insensitive):
*
P or Portrait (default)
*
L or Landscape
*
'' (empty string) for automatic orientation
@@ -2228,13 +2245,13 @@ class TCPDF {
/**
* Set page orientation.
- * @param $orientation (string) page orientation. Possible values are (case insensitive):
P or Portrait (default)
L or Landscape
'' (empty string) for automatic orientation
- * @param $autopagebreak (boolean) Boolean indicating if auto-page-break mode should be on or off.
- * @param $bottommargin (float) bottom margin of the page.
+ * @param string $orientation page orientation. Possible values are (case insensitive):
P or Portrait (default)
L or Landscape
'' (empty string) for automatic orientation
+ * @param boolean|null $autopagebreak Boolean indicating if auto-page-break mode should be on or off.
+ * @param float|null $bottommargin bottom margin of the page.
* @public
* @since 3.0.015 (2008-06-06)
*/
- public function setPageOrientation($orientation, $autopagebreak='', $bottommargin='') {
+ public function setPageOrientation($orientation, $autopagebreak=null, $bottommargin=null) {
if (!isset($this->pagedim[$this->page]['MediaBox'])) {
// the boundaries of the physical medium on which the page shall be displayed or printed
$this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'MediaBox', 0, 0, $this->fwPt, $this->fhPt, true, $this->k, $this->pagedim);
@@ -2306,7 +2323,7 @@ class TCPDF {
$bottommargin = 2 * 28.35 / $this->k;
}
}
- $this->SetAutoPageBreak($autopagebreak, $bottommargin);
+ $this->setAutoPageBreak($autopagebreak, $bottommargin);
// store page dimensions
$this->pagedim[$this->page]['w'] = $this->wPt;
$this->pagedim[$this->page]['h'] = $this->hPt;
@@ -2336,7 +2353,7 @@ class TCPDF {
* \p{Lo} : Unicode letter or ideograph that does not have lowercase and uppercase variants. Is used to chunk chinese words.
* \xa0 : Unicode Character 'NO-BREAK SPACE' (U+00A0)
*
- * @param $re (string) regular expression (leave empty for default).
+ * @param string $re regular expression (leave empty for default).
* @public
* @since 4.6.016 (2009-06-15)
*/
@@ -2360,8 +2377,8 @@ class TCPDF {
/**
* Enable or disable Right-To-Left language mode
- * @param $enable (Boolean) if true enable Right-To-Left language mode.
- * @param $resetx (Boolean) if true reset the X position on direction change.
+ * @param boolean $enable if true enable Right-To-Left language mode.
+ * @param boolean $resetx if true reset the X position on direction change.
* @public
* @since 2.0.000 (2008-01-03)
*/
@@ -2377,7 +2394,7 @@ class TCPDF {
/**
* Return the RTL status
- * @return boolean
+ * @return bool
* @public
* @since 4.0.012 (2008-07-24)
*/
@@ -2387,7 +2404,7 @@ class TCPDF {
/**
* Force temporary RTL language direction
- * @param $mode (mixed) can be false, 'L' for LTR or 'R' for RTL
+ * @param false|string $mode can be false, 'L' for LTR or 'R' for RTL
* @public
* @since 2.1.000 (2008-01-09)
*/
@@ -2419,7 +2436,7 @@ class TCPDF {
/**
* Return the current temporary RTL status
- * @return boolean
+ * @return bool
* @public
* @since 4.8.014 (2009-11-04)
*/
@@ -2429,7 +2446,7 @@ class TCPDF {
/**
* Set the last cell height.
- * @param $h (float) cell height.
+ * @param float $h cell height.
* @author Nicola Asuni
* @public
* @since 1.53.0.TC034
@@ -2440,9 +2457,10 @@ class TCPDF {
/**
* Return the cell height
- * @param $fontsize (int) Font size in internal units
- * @param $padding (boolean) If true add cell padding
+ * @param int $fontsize Font size in internal units
+ * @param boolean $padding If true add cell padding
* @public
+ * @return float
*/
public function getCellHeight($fontsize, $padding=TRUE) {
$height = ($fontsize * $this->cell_height_ratio);
@@ -2463,7 +2481,7 @@ class TCPDF {
/**
* Get the last cell height.
- * @return last cell height
+ * @return float last cell height
* @public
* @since 4.0.017 (2008-08-05)
*/
@@ -2473,7 +2491,7 @@ class TCPDF {
/**
* Set the adjusting factor to convert pixels to user units.
- * @param $scale (float) adjusting factor to convert pixels to user units.
+ * @param float $scale adjusting factor to convert pixels to user units.
* @author Nicola Asuni
* @public
* @since 1.5.2
@@ -2496,13 +2514,13 @@ class TCPDF {
/**
* Returns an array of page dimensions:
*
$this->pagedim[$this->page]['w'] = page width in points
$this->pagedim[$this->page]['h'] = height in points
$this->pagedim[$this->page]['wk'] = page width in user units
$this->pagedim[$this->page]['hk'] = page height in user units
$this->pagedim[$this->page]['tm'] = top margin
$this->pagedim[$this->page]['bm'] = bottom margin
$this->pagedim[$this->page]['lm'] = left margin
$this->pagedim[$this->page]['rm'] = right margin
$this->pagedim[$this->page]['pb'] = auto page break
$this->pagedim[$this->page]['olm'] = original left margin
$this->pagedim[$this->page]['orm'] = original right margin
$this->pagedim[$this->page]['Rotate'] = The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.
$this->pagedim[$this->page]['PZ'] = The page's preferred zoom (magnification) factor.
$this->pagedim[$this->page]['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation
$this->pagedim[$this->page]['trans']['Dur'] = The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.
$this->pagedim[$this->page]['trans']['D'] = The duration of the transition effect, in seconds.
$this->pagedim[$this->page]['trans']['Dm'] = (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.
$this->pagedim[$this->page]['trans']['M'] = (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.
$this->pagedim[$this->page]['trans']['Di'] = (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.
$this->pagedim[$this->page]['trans']['SS'] = (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.
$this->pagedim[$this->page]['trans']['B'] = (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.
$this->pagedim[$this->page]['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed
$this->pagedim[$this->page]['MediaBox']['llx'] = lower-left x coordinate in points
$this->pagedim[$this->page]['MediaBox']['lly'] = lower-left y coordinate in points
$this->pagedim[$this->page]['MediaBox']['urx'] = upper-right x coordinate in points
$this->pagedim[$this->page]['MediaBox']['ury'] = upper-right y coordinate in points
$this->pagedim[$this->page]['CropBox'] : the visible region of default user space
$this->pagedim[$this->page]['CropBox']['llx'] = lower-left x coordinate in points
$this->pagedim[$this->page]['CropBox']['lly'] = lower-left y coordinate in points
$this->pagedim[$this->page]['CropBox']['urx'] = upper-right x coordinate in points
$this->pagedim[$this->page]['CropBox']['ury'] = upper-right y coordinate in points
$this->pagedim[$this->page]['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment
$this->pagedim[$this->page]['BleedBox']['llx'] = lower-left x coordinate in points
$this->pagedim[$this->page]['BleedBox']['lly'] = lower-left y coordinate in points
$this->pagedim[$this->page]['BleedBox']['urx'] = upper-right x coordinate in points
$this->pagedim[$this->page]['BleedBox']['ury'] = upper-right y coordinate in points
$this->pagedim[$this->page]['TrimBox'] : the intended dimensions of the finished page after trimming
$this->pagedim[$this->page]['TrimBox']['llx'] = lower-left x coordinate in points
$this->pagedim[$this->page]['TrimBox']['lly'] = lower-left y coordinate in points
$this->pagedim[$this->page]['TrimBox']['urx'] = upper-right x coordinate in points
$this->pagedim[$this->page]['TrimBox']['ury'] = upper-right y coordinate in points
$this->pagedim[$this->page]['ArtBox'] : the extent of the page's meaningful content
$this->pagedim[$this->page]['ArtBox']['llx'] = lower-left x coordinate in points
$this->pagedim[$this->page]['ArtBox']['lly'] = lower-left y coordinate in points
$this->pagedim[$this->page]['ArtBox']['urx'] = upper-right x coordinate in points
$this->pagedim[$this->page]['ArtBox']['ury'] = upper-right y coordinate in points
- * @param $pagenum (int) page number (empty = current page)
+ * @param int|null $pagenum page number (empty = current page)
* @return array of page dimensions.
* @author Nicola Asuni
* @public
* @since 4.5.027 (2009-03-16)
*/
- public function getPageDimensions($pagenum='') {
+ public function getPageDimensions($pagenum=null) {
if (empty($pagenum)) {
$pagenum = $this->page;
}
@@ -2511,14 +2529,14 @@ class TCPDF {
/**
* Returns the page width in units.
- * @param $pagenum (int) page number (empty = current page)
+ * @param int|null $pagenum page number (empty = current page)
* @return int page width.
* @author Nicola Asuni
* @public
* @since 1.5.2
* @see getPageDimensions()
*/
- public function getPageWidth($pagenum='') {
+ public function getPageWidth($pagenum=null) {
if (empty($pagenum)) {
return $this->w;
}
@@ -2527,14 +2545,14 @@ class TCPDF {
/**
* Returns the page height in units.
- * @param $pagenum (int) page number (empty = current page)
+ * @param int|null $pagenum page number (empty = current page)
* @return int page height.
* @author Nicola Asuni
* @public
* @since 1.5.2
* @see getPageDimensions()
*/
- public function getPageHeight($pagenum='') {
+ public function getPageHeight($pagenum=null) {
if (empty($pagenum)) {
return $this->h;
}
@@ -2543,14 +2561,14 @@ class TCPDF {
/**
* Returns the page break margin.
- * @param $pagenum (int) page number (empty = current page)
+ * @param int|null $pagenum page number (empty = current page)
* @return int page break margin.
* @author Nicola Asuni
* @public
* @since 1.5.2
* @see getPageDimensions()
*/
- public function getBreakMargin($pagenum='') {
+ public function getBreakMargin($pagenum=null) {
if (empty($pagenum)) {
return $this->bMargin;
}
@@ -2570,19 +2588,19 @@ class TCPDF {
/**
* Defines the left, top and right margins.
- * @param $left (float) Left margin.
- * @param $top (float) Top margin.
- * @param $right (float) Right margin. Default value is the left one.
- * @param $keepmargins (boolean) if true overwrites the default page margins
+ * @param float $left Left margin.
+ * @param float $top Top margin.
+ * @param float $right Right margin. Default value is the left one.
+ * @param boolean $keepmargins if true overwrites the default page margins
* @public
* @since 1.0
* @see SetLeftMargin(), SetTopMargin(), SetRightMargin(), SetAutoPageBreak()
*/
- public function SetMargins($left, $top, $right=-1, $keepmargins=false) {
+ public function setMargins($left, $top, $right=null, $keepmargins=false) {
//Set left, top and right margins
$this->lMargin = $left;
$this->tMargin = $top;
- if ($right == -1) {
+ if ($right == -1 OR $right === null) {
$right = $left;
}
$this->rMargin = $right;
@@ -2595,12 +2613,12 @@ class TCPDF {
/**
* Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin.
- * @param $margin (float) The margin.
+ * @param float $margin The margin.
* @public
* @since 1.4
* @see SetTopMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins()
*/
- public function SetLeftMargin($margin) {
+ public function setLeftMargin($margin) {
//Set left margin
$this->lMargin = $margin;
if (($this->page > 0) AND ($this->x < $margin)) {
@@ -2610,12 +2628,12 @@ class TCPDF {
/**
* Defines the top margin. The method can be called before creating the first page.
- * @param $margin (float) The margin.
+ * @param float $margin The margin.
* @public
* @since 1.5
* @see SetLeftMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins()
*/
- public function SetTopMargin($margin) {
+ public function setTopMargin($margin) {
//Set top margin
$this->tMargin = $margin;
if (($this->page > 0) AND ($this->y < $margin)) {
@@ -2625,12 +2643,12 @@ class TCPDF {
/**
* Defines the right margin. The method can be called before creating the first page.
- * @param $margin (float) The margin.
+ * @param float $margin The margin.
* @public
* @since 1.5
* @see SetLeftMargin(), SetTopMargin(), SetAutoPageBreak(), SetMargins()
*/
- public function SetRightMargin($margin) {
+ public function setRightMargin($margin) {
$this->rMargin = $margin;
if (($this->page > 0) AND ($this->x > ($this->w - $margin))) {
$this->x = $this->w - $margin;
@@ -2639,12 +2657,12 @@ class TCPDF {
/**
* Set the same internal Cell padding for top, right, bottom, left-
- * @param $pad (float) internal padding.
+ * @param float $pad internal padding.
* @public
* @since 2.1.000 (2008-01-09)
* @see getCellPaddings(), setCellPaddings()
*/
- public function SetCellPadding($pad) {
+ public function setCellPadding($pad) {
if ($pad >= 0) {
$this->cell_padding['L'] = $pad;
$this->cell_padding['T'] = $pad;
@@ -2655,25 +2673,25 @@ class TCPDF {
/**
* Set the internal Cell paddings.
- * @param $left (float) left padding
- * @param $top (float) top padding
- * @param $right (float) right padding
- * @param $bottom (float) bottom padding
+ * @param float|null $left left padding
+ * @param float|null $top top padding
+ * @param float|null $right right padding
+ * @param float|null $bottom bottom padding
* @public
* @since 5.9.000 (2010-10-03)
* @see getCellPaddings(), SetCellPadding()
*/
- public function setCellPaddings($left='', $top='', $right='', $bottom='') {
- if (($left !== '') AND ($left >= 0)) {
+ public function setCellPaddings($left=null, $top=null, $right=null, $bottom=null) {
+ if (!TCPDF_STATIC::empty_string($left) AND ($left >= 0)) {
$this->cell_padding['L'] = $left;
}
- if (($top !== '') AND ($top >= 0)) {
+ if (!TCPDF_STATIC::empty_string($top) AND ($top >= 0)) {
$this->cell_padding['T'] = $top;
}
- if (($right !== '') AND ($right >= 0)) {
+ if (!TCPDF_STATIC::empty_string($right) AND ($right >= 0)) {
$this->cell_padding['R'] = $right;
}
- if (($bottom !== '') AND ($bottom >= 0)) {
+ if (!TCPDF_STATIC::empty_string($bottom) AND ($bottom >= 0)) {
$this->cell_padding['B'] = $bottom;
}
}
@@ -2691,25 +2709,25 @@ class TCPDF {
/**
* Set the internal Cell margins.
- * @param $left (float) left margin
- * @param $top (float) top margin
- * @param $right (float) right margin
- * @param $bottom (float) bottom margin
+ * @param float|null $left left margin
+ * @param float|null $top top margin
+ * @param float|null $right right margin
+ * @param float|null $bottom bottom margin
* @public
* @since 5.9.000 (2010-10-03)
* @see getCellMargins()
*/
- public function setCellMargins($left='', $top='', $right='', $bottom='') {
- if (($left !== '') AND ($left >= 0)) {
+ public function setCellMargins($left=null, $top=null, $right=null, $bottom=null) {
+ if (!TCPDF_STATIC::empty_string($left) AND ($left >= 0)) {
$this->cell_margin['L'] = $left;
}
- if (($top !== '') AND ($top >= 0)) {
+ if (!TCPDF_STATIC::empty_string($top) AND ($top >= 0)) {
$this->cell_margin['T'] = $top;
}
- if (($right !== '') AND ($right >= 0)) {
+ if (!TCPDF_STATIC::empty_string($right) AND ($right >= 0)) {
$this->cell_margin['R'] = $right;
}
- if (($bottom !== '') AND ($bottom >= 0)) {
+ if (!TCPDF_STATIC::empty_string($bottom) AND ($bottom >= 0)) {
$this->cell_margin['B'] = $bottom;
}
}
@@ -2727,8 +2745,8 @@ class TCPDF {
/**
* Adjust the internal Cell padding array to take account of the line width.
- * @param $brd (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
- * @return array of adjustments
+ * @param string|array|int $brd Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * @return void|array array of adjustments
* @public
* @since 5.9.000 (2010-10-03)
*/
@@ -2744,7 +2762,11 @@ class TCPDF {
$newbrd[$brd[$i]] = true;
}
$brd = $newbrd;
- } elseif (($brd === 1) OR ($brd === true) OR (is_numeric($brd) AND (intval($brd) > 0))) {
+ } elseif (
+ ($brd === 1)
+ || ($brd === true)
+ || (is_numeric($brd) && ((int)$brd > 0))
+ ) {
$brd = array('LRTB' => true);
}
if (!is_array($brd)) {
@@ -2762,7 +2784,7 @@ class TCPDF {
// process borders
foreach ($brd as $border => $style) {
$line_width = $this->LineWidth;
- if (is_array($style) AND isset($style['width'])) {
+ if (is_array($style) && isset($style['width'])) {
// get border width
$line_width = $style['width'];
}
@@ -2783,31 +2805,54 @@ class TCPDF {
}
}
// correct internal cell padding if required to avoid overlap between text and lines
- if ((strpos($border,'T') !== false) AND ($this->cell_padding['T'] < $adj)) {
+ if (
+ is_numeric($this->cell_padding['T'])
+ && ($this->cell_padding['T'] < $adj)
+ && (strpos($border, 'T') !== false)
+ ) {
$this->cell_padding['T'] = $adj;
}
- if ((strpos($border,'R') !== false) AND ($this->cell_padding['R'] < $adj)) {
+ if (
+ is_numeric($this->cell_padding['R'])
+ && ($this->cell_padding['R'] < $adj)
+ && (strpos($border, 'R') !== false)
+ ) {
$this->cell_padding['R'] = $adj;
}
- if ((strpos($border,'B') !== false) AND ($this->cell_padding['B'] < $adj)) {
+ if (
+ is_numeric($this->cell_padding['B'])
+ && ($this->cell_padding['B'] < $adj)
+ && (strpos($border, 'B') !== false)
+ ) {
$this->cell_padding['B'] = $adj;
}
- if ((strpos($border,'L') !== false) AND ($this->cell_padding['L'] < $adj)) {
+ if (
+ is_numeric($this->cell_padding['L'])
+ && ($this->cell_padding['L'] < $adj)
+ && (strpos($border, 'L') !== false)
+ ) {
$this->cell_padding['L'] = $adj;
}
+
}
- return array('T' => ($this->cell_padding['T'] - $cp['T']), 'R' => ($this->cell_padding['R'] - $cp['R']), 'B' => ($this->cell_padding['B'] - $cp['B']), 'L' => ($this->cell_padding['L'] - $cp['L']));
+
+ return array(
+ 'T' => ($this->cell_padding['T'] - $cp['T']),
+ 'R' => ($this->cell_padding['R'] - $cp['R']),
+ 'B' => ($this->cell_padding['B'] - $cp['B']),
+ 'L' => ($this->cell_padding['L'] - $cp['L']),
+ );
}
/**
* Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.
- * @param $auto (boolean) Boolean indicating if mode should be on or off.
- * @param $margin (float) Distance from the bottom of the page.
+ * @param boolean $auto Boolean indicating if mode should be on or off.
+ * @param float $margin Distance from the bottom of the page.
* @public
* @since 1.0
* @see Cell(), MultiCell(), AcceptPageBreak()
*/
- public function SetAutoPageBreak($auto, $margin=0) {
+ public function setAutoPageBreak($auto, $margin=0) {
$this->AutoPageBreak = $auto ? true : false;
$this->bMargin = $margin;
$this->PageBreakTrigger = $this->h - $margin;
@@ -2815,7 +2860,7 @@ class TCPDF {
/**
* Return the auto-page-break mode (true or false).
- * @return boolean auto-page-break mode
+ * @return bool auto-page-break mode
* @public
* @since 5.9.088
*/
@@ -2825,13 +2870,13 @@ class TCPDF {
/**
* Defines the way the document is to be displayed by the viewer.
- * @param $zoom (mixed) The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use.
fullpage: displays the entire page on screen
fullwidth: uses maximum width of window
real: uses real size (equivalent to 100% zoom)
default: uses viewer default mode
- * @param $layout (string) The page layout. Possible values are:
SinglePage Display one page at a time
OneColumn Display the pages in one column
TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left
TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right
TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right
- * @param $mode (string) A name object specifying how the document should be displayed when opened:
UseNone Neither document outline nor thumbnail images visible
UseOutlines Document outline visible
UseThumbs Thumbnail images visible
FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible
UseOC (PDF 1.5) Optional content group panel visible
* @public
* @since 1.2
*/
- public function SetDisplayMode($zoom, $layout='SinglePage', $mode='UseNone') {
+ public function setDisplayMode($zoom, $layout='SinglePage', $mode='UseNone') {
if (($zoom == 'fullpage') OR ($zoom == 'fullwidth') OR ($zoom == 'real') OR ($zoom == 'default') OR (!is_string($zoom))) {
$this->ZoomMode = $zoom;
} else {
@@ -2844,11 +2889,11 @@ class TCPDF {
/**
* Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default.
* Note: the Zlib extension is required for this feature. If not present, compression will be turned off.
- * @param $compress (boolean) Boolean indicating if compression must be enabled.
+ * @param boolean $compress Boolean indicating if compression must be enabled.
* @public
* @since 1.4
*/
- public function SetCompression($compress=true) {
+ public function setCompression($compress=true) {
$this->compress = false;
if (function_exists('gzcompress')) {
if ($compress) {
@@ -2861,7 +2906,7 @@ class TCPDF {
/**
* Set flag to force sRGB_IEC61966-2.1 black scaled ICC color profile for the whole document.
- * @param $mode (boolean) If true force sRGB output intent.
+ * @param boolean $mode If true force sRGB output intent.
* @public
* @since 5.9.121 (2011-09-28)
*/
@@ -2872,72 +2917,84 @@ class TCPDF {
/**
* Turn on/off Unicode mode for document information dictionary (meta tags).
* This has effect only when unicode mode is set to false.
- * @param $unicode (boolean) if true set the meta information in Unicode
+ * @param boolean $unicode if true set the meta information in Unicode
* @since 5.9.027 (2010-12-01)
* @public
*/
- public function SetDocInfoUnicode($unicode=true) {
+ public function setDocInfoUnicode($unicode=true) {
$this->docinfounicode = $unicode ? true : false;
}
/**
* Defines the title of the document.
- * @param $title (string) The title.
+ * @param string $title The title.
* @public
* @since 1.2
* @see SetAuthor(), SetCreator(), SetKeywords(), SetSubject()
*/
- public function SetTitle($title) {
+ public function setTitle($title) {
$this->title = $title;
}
/**
* Defines the subject of the document.
- * @param $subject (string) The subject.
+ * @param string $subject The subject.
* @public
* @since 1.2
* @see SetAuthor(), SetCreator(), SetKeywords(), SetTitle()
*/
- public function SetSubject($subject) {
+ public function setSubject($subject) {
$this->subject = $subject;
}
/**
* Defines the author of the document.
- * @param $author (string) The name of the author.
+ * @param string $author The name of the author.
* @public
* @since 1.2
* @see SetCreator(), SetKeywords(), SetSubject(), SetTitle()
*/
- public function SetAuthor($author) {
+ public function setAuthor($author) {
$this->author = $author;
}
/**
* Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'.
- * @param $keywords (string) The list of keywords.
+ * @param string $keywords The list of keywords.
* @public
* @since 1.2
* @see SetAuthor(), SetCreator(), SetSubject(), SetTitle()
*/
- public function SetKeywords($keywords) {
+ public function setKeywords($keywords) {
$this->keywords = $keywords;
}
/**
* Defines the creator of the document. This is typically the name of the application that generates the PDF.
- * @param $creator (string) The name of the creator.
+ * @param string $creator The name of the creator.
* @public
* @since 1.2
* @see SetAuthor(), SetKeywords(), SetSubject(), SetTitle()
*/
- public function SetCreator($creator) {
+ public function setCreator($creator) {
$this->creator = $creator;
}
+ /**
+ * Whether to allow local file path in image html tags, when prefixed with file://
+ *
+ * @param bool $allowLocalFiles true, when local files should be allowed. Otherwise false.
+ * @public
+ * @since 6.4
+ */
+ public function setAllowLocalFiles($allowLocalFiles) {
+ $this->allowLocalFiles = (bool) $allowLocalFiles;
+ }
+
+
/**
* Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true.
- * @param $msg (string) The error message
+ * @param string $msg The error message
* @public
* @since 1.0
*/
@@ -2984,13 +3041,13 @@ class TCPDF {
$gvars = $this->getGraphicVars();
$this->setEqualColumns();
$this->lastpage(true);
- $this->SetAutoPageBreak(false);
+ $this->setAutoPageBreak(false);
$this->x = 0;
$this->y = $this->h - (1 / $this->k);
$this->lMargin = 0;
$this->_outSaveGraphicsState();
$font = defined('PDF_FONT_NAME_MAIN')?PDF_FONT_NAME_MAIN:'helvetica';
- $this->SetFont($font, '', 1);
+ $this->setFont($font, '', 1);
$this->setTextRenderingMode(0, false, false);
$msg = "\x50\x6f\x77\x65\x72\x65\x64\x20\x62\x79\x20\x54\x43\x50\x44\x46\x20\x28\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67\x29";
$lnk = "\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67";
@@ -3009,8 +3066,8 @@ class TCPDF {
/**
* Move pointer at the specified document page and update page dimensions.
- * @param $pnum (int) page number (1 ... numpages)
- * @param $resetmargins (boolean) if true reset left, right, top margins and Y position.
+ * @param int $pnum page number (1 ... numpages)
+ * @param boolean $resetmargins if true reset left, right, top margins and Y position.
* @public
* @since 2.1.000 (2008-01-07)
* @see getPage(), lastpage(), getNumPages()
@@ -3035,13 +3092,13 @@ class TCPDF {
$this->original_rMargin = $this->pagedim[$this->page]['orm'];
$this->AutoPageBreak = $this->pagedim[$this->page]['pb'];
$this->CurOrientation = $this->pagedim[$this->page]['or'];
- $this->SetAutoPageBreak($this->AutoPageBreak, $this->bMargin);
+ $this->setAutoPageBreak($this->AutoPageBreak, $this->bMargin);
// restore graphic settings
//$this->setGraphicVars($gvars);
if ($resetmargins) {
$this->lMargin = $this->pagedim[$this->page]['olm'];
$this->rMargin = $this->pagedim[$this->page]['orm'];
- $this->SetY($this->tMargin);
+ $this->setY($this->tMargin);
} else {
// account for booklet mode
if ($this->pagedim[$this->page]['olm'] != $this->pagedim[$oldpage]['olm']) {
@@ -3057,7 +3114,7 @@ class TCPDF {
/**
* Reset pointer to the last document page.
- * @param $resetmargins (boolean) if true reset left, right, top margins and Y position.
+ * @param boolean $resetmargins if true reset left, right, top margins and Y position.
* @public
* @since 2.0.000 (2008-01-04)
* @see setPage(), getPage(), getNumPages()
@@ -3090,9 +3147,9 @@ class TCPDF {
/**
* Adds a new TOC (Table Of Content) page to the document.
- * @param $orientation (string) page orientation.
- * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().
- * @param $keepmargins (boolean) if true overwrites the default page margins with the current margins
+ * @param string $orientation page orientation.
+ * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().
+ * @param boolean $keepmargins if true overwrites the default page margins with the current margins
* @public
* @since 5.0.001 (2010-05-06)
* @see AddPage(), startPage(), endPage(), endTOCPage()
@@ -3114,10 +3171,10 @@ class TCPDF {
/**
* Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled).
* The origin of the coordinate system is at the top-left corner (or top-right for RTL) and increasing ordinates go downwards.
- * @param $orientation (string) page orientation. Possible values are (case insensitive):
P or PORTRAIT (default)
L or LANDSCAPE
- * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().
- * @param $keepmargins (boolean) if true overwrites the default page margins with the current margins
- * @param $tocpage (boolean) if true set the tocpage state to true (the added page will be used to display Table Of Content).
+ * @param string $orientation page orientation. Possible values are (case insensitive):
P or PORTRAIT (default)
L or LANDSCAPE
+ * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().
+ * @param boolean $keepmargins if true overwrites the default page margins with the current margins
+ * @param boolean $tocpage if true set the tocpage state to true (the added page will be used to display Table Of Content).
* @public
* @since 1.0
* @see startPage(), endPage(), addTOCPage(), endTOCPage(), getPageSizeFromFormat(), setPageFormat()
@@ -3141,7 +3198,7 @@ class TCPDF {
/**
* Terminate the current page
- * @param $tocpage (boolean) if true set the tocpage state to false (end the page used to display Table Of Content).
+ * @param boolean $tocpage if true set the tocpage state to false (end the page used to display Table Of Content).
* @public
* @since 4.2.010 (2008-11-14)
* @see AddPage(), startPage(), addTOCPage(), endTOCPage()
@@ -3165,9 +3222,9 @@ class TCPDF {
/**
* Starts a new page to the document. The page must be closed using the endPage() function.
* The origin of the coordinate system is at the top-left corner and increasing ordinates go downwards.
- * @param $orientation (string) page orientation. Possible values are (case insensitive):
P or PORTRAIT (default)
L or LANDSCAPE
- * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().
- * @param $tocpage (boolean) if true the page is designated to contain the Table-Of-Content.
+ * @param string $orientation page orientation. Possible values are (case insensitive):
P or PORTRAIT (default)
L or LANDSCAPE
+ * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().
+ * @param boolean $tocpage if true the page is designated to contain the Table-Of-Content.
* @since 4.2.010 (2008-11-14)
* @see AddPage(), endPage(), addTOCPage(), endTOCPage(), getPageSizeFromFormat(), setPageFormat()
* @public
@@ -3204,7 +3261,7 @@ class TCPDF {
if ($this->numpages > $this->page) {
// this page has been already added
$this->setPage($this->page + 1);
- $this->SetY($this->tMargin);
+ $this->setY($this->tMargin);
return;
}
// start a new page
@@ -3252,7 +3309,7 @@ class TCPDF {
/**
* Set start-writing mark on selected page.
* Borders and fills are always created after content and inserted on the position marked by this method.
- * @param $page (int) page number (default is the current page)
+ * @param int $page page number (default is the current page)
* @protected
* @since 4.6.021 (2009-07-20)
*/
@@ -3269,12 +3326,12 @@ class TCPDF {
/**
* Set header data.
- * @param $ln (string) header image logo
- * @param $lw (string) header image logo width in mm
- * @param $ht (string) string to print as title on document header
- * @param $hs (string) string to print on document header
- * @param $tc (array) RGB array color for text.
- * @param $lc (array) RGB array color for line.
+ * @param string $ln header image logo
+ * @param int $lw header image logo width in mm
+ * @param string $ht string to print as title on document header
+ * @param string $hs string to print on document header
+ * @param int[] $tc RGB array color for text.
+ * @param int[] $lc RGB array color for line.
* @public
*/
public function setHeaderData($ln='', $lw=0, $ht='', $hs='', $tc=array(0,0,0), $lc=array(0,0,0)) {
@@ -3288,8 +3345,8 @@ class TCPDF {
/**
* Set footer data.
- * @param $tc (array) RGB array color for text.
- * @param $lc (array) RGB array color for line.
+ * @param int[] $tc RGB array color for text.
+ * @param int[] $lc RGB array color for line.
* @public
*/
public function setFooterData($tc=array(0,0,0), $lc=array(0,0,0)) {
@@ -3300,7 +3357,7 @@ class TCPDF {
/**
* Returns header data:
*
$ret['logo'] = logo image
$ret['logo_width'] = width of the image logo in user units
$ret['title'] = header title
$ret['string'] = header description string
- * @return array()
+ * @return array
* @public
* @since 4.0.012 (2008-07-24)
*/
@@ -3318,7 +3375,7 @@ class TCPDF {
/**
* Set header margin.
* (minimum distance between header and top page margin)
- * @param $hm (int) distance in user units
+ * @param int $hm distance in user units
* @public
*/
public function setHeaderMargin($hm=10) {
@@ -3338,7 +3395,7 @@ class TCPDF {
/**
* Set footer margin.
* (minimum distance between footer and bottom page margin)
- * @param $fm (int) distance in user units
+ * @param int $fm distance in user units
* @public
*/
public function setFooterMargin($fm=10) {
@@ -3356,7 +3413,7 @@ class TCPDF {
}
/**
* Set a flag to print page header.
- * @param $val (boolean) set to true to print the page header (default), false otherwise.
+ * @param boolean $val set to true to print the page header (default), false otherwise.
* @public
*/
public function setPrintHeader($val=true) {
@@ -3365,7 +3422,7 @@ class TCPDF {
/**
* Set a flag to print page footer.
- * @param $val (boolean) set to true to print the page footer (default), false otherwise.
+ * @param boolean $val set to true to print the page footer (default), false otherwise.
* @public
*/
public function setPrintFooter($val=true) {
@@ -3400,7 +3457,7 @@ class TCPDF {
/**
* Set a flag to automatically reset the xobject template used by Header() method at each page.
- * @param $val (boolean) set to true to reset Header xobject template at each page, false otherwise.
+ * @param boolean $val set to true to reset Header xobject template at each page, false otherwise.
* @public
*/
public function setHeaderTemplateAutoreset($val=true) {
@@ -3445,22 +3502,22 @@ class TCPDF {
$header_x = $this->original_lMargin + ($headerdata['logo_width'] * 1.1);
}
$cw = $this->w - $this->original_lMargin - $this->original_rMargin - ($headerdata['logo_width'] * 1.1);
- $this->SetTextColorArray($this->header_text_color);
+ $this->setTextColorArray($this->header_text_color);
// header title
- $this->SetFont($headerfont[0], 'B', $headerfont[2] + 1);
- $this->SetX($header_x);
+ $this->setFont($headerfont[0], 'B', $headerfont[2] + 1);
+ $this->setX($header_x);
$this->Cell($cw, $cell_height, $headerdata['title'], 0, 1, '', 0, '', 0);
// header string
- $this->SetFont($headerfont[0], $headerfont[1], $headerfont[2]);
- $this->SetX($header_x);
+ $this->setFont($headerfont[0], $headerfont[1], $headerfont[2]);
+ $this->setX($header_x);
$this->MultiCell($cw, $cell_height, $headerdata['string'], 0, '', 0, 1, '', '', true, 0, false, true, 0, 'T', false);
// print an ending header line
- $this->SetLineStyle(array('width' => 0.85 / $this->k, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $headerdata['line_color']));
- $this->SetY((2.835 / $this->k) + max($imgy, $this->y));
+ $this->setLineStyle(array('width' => 0.85 / $this->k, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $headerdata['line_color']));
+ $this->setY((2.835 / $this->k) + max($imgy, $this->y));
if ($this->rtl) {
- $this->SetX($this->original_rMargin);
+ $this->setX($this->original_rMargin);
} else {
- $this->SetX($this->original_lMargin);
+ $this->setX($this->original_lMargin);
}
$this->Cell(($this->w - $this->original_lMargin - $this->original_rMargin), 0, '', 'T', 0, 'C');
$this->endTemplate();
@@ -3491,10 +3548,10 @@ class TCPDF {
*/
public function Footer() {
$cur_y = $this->y;
- $this->SetTextColorArray($this->footer_text_color);
+ $this->setTextColorArray($this->footer_text_color);
//set style for cell border
$line_width = (0.85 / $this->k);
- $this->SetLineStyle(array('width' => $line_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $this->footer_line_color));
+ $this->setLineStyle(array('width' => $line_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $this->footer_line_color));
//print document barcode
$barcode = $this->getBarcode();
if (!empty($barcode)) {
@@ -3520,13 +3577,13 @@ class TCPDF {
} else {
$pagenumtxt = $w_page.$this->getPageNumGroupAlias().' / '.$this->getPageGroupAlias();
}
- $this->SetY($cur_y);
+ $this->setY($cur_y);
//Print page number
if ($this->getRTL()) {
- $this->SetX($this->original_rMargin);
+ $this->setX($this->original_rMargin);
$this->Cell(0, 0, $pagenumtxt, 'T', 0, 'L');
} else {
- $this->SetX($this->original_lMargin);
+ $this->setX($this->original_lMargin);
$this->Cell(0, 0, $this->getAliasRightShift().$pagenumtxt, 'T', 0, 'R');
}
}
@@ -3549,20 +3606,20 @@ class TCPDF {
$this->_outSaveGraphicsState();
$this->rMargin = $this->original_rMargin;
$this->lMargin = $this->original_lMargin;
- $this->SetCellPadding(0);
+ $this->setCellPadding(0);
//set current position
if ($this->rtl) {
- $this->SetXY($this->original_rMargin, $this->header_margin);
+ $this->setXY($this->original_rMargin, $this->header_margin);
} else {
- $this->SetXY($this->original_lMargin, $this->header_margin);
+ $this->setXY($this->original_lMargin, $this->header_margin);
}
- $this->SetFont($this->header_font[0], $this->header_font[1], $this->header_font[2]);
+ $this->setFont($this->header_font[0], $this->header_font[1], $this->header_font[2]);
$this->Header();
//restore position
if ($this->rtl) {
- $this->SetXY($this->original_rMargin, $this->tMargin);
+ $this->setXY($this->original_rMargin, $this->tMargin);
} else {
- $this->SetXY($this->original_lMargin, $this->tMargin);
+ $this->setXY($this->original_lMargin, $this->tMargin);
}
$this->_outRestoreGraphicsState();
$this->lasth = $lasth;
@@ -3597,21 +3654,21 @@ class TCPDF {
$this->_outSaveGraphicsState();
$this->rMargin = $this->original_rMargin;
$this->lMargin = $this->original_lMargin;
- $this->SetCellPadding(0);
+ $this->setCellPadding(0);
//set current position
$footer_y = $this->h - $this->footer_margin;
if ($this->rtl) {
- $this->SetXY($this->original_rMargin, $footer_y);
+ $this->setXY($this->original_rMargin, $footer_y);
} else {
- $this->SetXY($this->original_lMargin, $footer_y);
+ $this->setXY($this->original_lMargin, $footer_y);
}
- $this->SetFont($this->footer_font[0], $this->footer_font[1], $this->footer_font[2]);
+ $this->setFont($this->footer_font[0], $this->footer_font[1], $this->footer_font[2]);
$this->Footer();
//restore position
if ($this->rtl) {
- $this->SetXY($this->original_rMargin, $this->tMargin);
+ $this->setXY($this->original_rMargin, $this->tMargin);
} else {
- $this->SetXY($this->original_lMargin, $this->tMargin);
+ $this->setXY($this->original_lMargin, $this->tMargin);
}
$this->_outRestoreGraphicsState();
$this->lasth = $lasth;
@@ -3629,7 +3686,7 @@ class TCPDF {
/**
* Check if we are on the page body (excluding page header and footer).
- * @return true if we are not in page header nor in page footer, false otherwise.
+ * @return bool true if we are not in page header nor in page footer, false otherwise.
* @protected
* @since 5.9.091 (2011-06-15)
*/
@@ -3715,7 +3772,7 @@ class TCPDF {
/**
* Returns the array of spot colors.
- * @return (array) Spot colors array.
+ * @return array Spot colors array.
* @public
* @since 6.0.038 (2013-09-30)
*/
@@ -3727,11 +3784,11 @@ class TCPDF {
* Defines a new spot color.
* It can be expressed in RGB components or gray scale.
* The method can be called before the first page is created and the value is retained from page to page.
- * @param $name (string) Full name of the spot color.
- * @param $c (float) Cyan color for CMYK. Value between 0 and 100.
- * @param $m (float) Magenta color for CMYK. Value between 0 and 100.
- * @param $y (float) Yellow color for CMYK. Value between 0 and 100.
- * @param $k (float) Key (Black) color for CMYK. Value between 0 and 100.
+ * @param string $name Full name of the spot color.
+ * @param float $c Cyan color for CMYK. Value between 0 and 100.
+ * @param float $m Magenta color for CMYK. Value between 0 and 100.
+ * @param float $y Yellow color for CMYK. Value between 0 and 100.
+ * @param float $k Key (Black) color for CMYK. Value between 0 and 100.
* @public
* @since 4.0.024 (2008-09-12)
* @see SetDrawSpotColor(), SetFillSpotColor(), SetTextSpotColor()
@@ -3745,10 +3802,10 @@ class TCPDF {
/**
* Set the spot color for the specified type ('draw', 'fill', 'text').
- * @param $type (string) Type of object affected by this color: ('draw', 'fill', 'text').
- * @param $name (string) Name of the spot color.
- * @param $tint (float) Intensity of the color (from 0 to 100 ; 100 = full intensity by default).
- * @return (string) PDF color command.
+ * @param string $type Type of object affected by this color: ('draw', 'fill', 'text').
+ * @param string $name Name of the spot color.
+ * @param float $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default).
+ * @return string PDF color command.
* @public
* @since 5.9.125 (2011-10-03)
*/
@@ -3792,37 +3849,37 @@ class TCPDF {
/**
* Defines the spot color used for all drawing operations (lines, rectangles and cell borders).
- * @param $name (string) Name of the spot color.
- * @param $tint (float) Intensity of the color (from 0 to 100 ; 100 = full intensity by default).
+ * @param string $name Name of the spot color.
+ * @param float $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default).
* @public
* @since 4.0.024 (2008-09-12)
* @see AddSpotColor(), SetFillSpotColor(), SetTextSpotColor()
*/
- public function SetDrawSpotColor($name, $tint=100) {
+ public function setDrawSpotColor($name, $tint=100) {
$this->setSpotColor('draw', $name, $tint);
}
/**
* Defines the spot color used for all filling operations (filled rectangles and cell backgrounds).
- * @param $name (string) Name of the spot color.
- * @param $tint (float) Intensity of the color (from 0 to 100 ; 100 = full intensity by default).
+ * @param string $name Name of the spot color.
+ * @param float $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default).
* @public
* @since 4.0.024 (2008-09-12)
* @see AddSpotColor(), SetDrawSpotColor(), SetTextSpotColor()
*/
- public function SetFillSpotColor($name, $tint=100) {
+ public function setFillSpotColor($name, $tint=100) {
$this->setSpotColor('fill', $name, $tint);
}
/**
* Defines the spot color used for text.
- * @param $name (string) Name of the spot color.
- * @param $tint (int) Intensity of the color (from 0 to 100 ; 100 = full intensity by default).
+ * @param string $name Name of the spot color.
+ * @param int $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default).
* @public
* @since 4.0.024 (2008-09-12)
* @see AddSpotColor(), SetDrawSpotColor(), SetFillSpotColor()
*/
- public function SetTextSpotColor($name, $tint=100) {
+ public function setTextSpotColor($name, $tint=100) {
$this->setSpotColor('text', $name, $tint);
}
@@ -3830,10 +3887,10 @@ class TCPDF {
* Set the color array for the specified type ('draw', 'fill', 'text').
* It can be expressed in RGB, CMYK or GRAY SCALE components.
* The method can be called before the first page is created and the value is retained from page to page.
- * @param $type (string) Type of object affected by this color: ('draw', 'fill', 'text').
- * @param $color (array) Array of colors (1=gray, 3=RGB, 4=CMYK or 5=spotcolor=CMYK+name values).
- * @param $ret (boolean) If true do not send the PDF command.
- * @return (string) The PDF command or empty string.
+ * @param string $type Type of object affected by this color: ('draw', 'fill', 'text').
+ * @param array $color Array of colors (1=gray, 3=RGB, 4=CMYK or 5=spotcolor=CMYK+name values).
+ * @param boolean $ret If true do not send the PDF command.
+ * @return string The PDF command or empty string.
* @public
* @since 3.1.000 (2008-06-11)
*/
@@ -3861,14 +3918,14 @@ class TCPDF {
* Defines the color used for all drawing operations (lines, rectangles and cell borders).
* It can be expressed in RGB, CMYK or GRAY SCALE components.
* The method can be called before the first page is created and the value is retained from page to page.
- * @param $color (array) Array of colors (1, 3 or 4 values).
- * @param $ret (boolean) If true do not send the PDF command.
+ * @param array $color Array of colors (1, 3 or 4 values).
+ * @param boolean $ret If true do not send the PDF command.
* @return string the PDF command
* @public
* @since 3.1.000 (2008-06-11)
* @see SetDrawColor()
*/
- public function SetDrawColorArray($color, $ret=false) {
+ public function setDrawColorArray($color, $ret=false) {
return $this->setColorArray('draw', $color, $ret);
}
@@ -3876,39 +3933,39 @@ class TCPDF {
* Defines the color used for all filling operations (filled rectangles and cell backgrounds).
* It can be expressed in RGB, CMYK or GRAY SCALE components.
* The method can be called before the first page is created and the value is retained from page to page.
- * @param $color (array) Array of colors (1, 3 or 4 values).
- * @param $ret (boolean) If true do not send the PDF command.
+ * @param array $color Array of colors (1, 3 or 4 values).
+ * @param boolean $ret If true do not send the PDF command.
* @public
* @since 3.1.000 (2008-6-11)
* @see SetFillColor()
*/
- public function SetFillColorArray($color, $ret=false) {
+ public function setFillColorArray($color, $ret=false) {
return $this->setColorArray('fill', $color, $ret);
}
/**
* Defines the color used for text. It can be expressed in RGB components or gray scale.
* The method can be called before the first page is created and the value is retained from page to page.
- * @param $color (array) Array of colors (1, 3 or 4 values).
- * @param $ret (boolean) If true do not send the PDF command.
+ * @param array $color Array of colors (1, 3 or 4 values).
+ * @param boolean $ret If true do not send the PDF command.
* @public
* @since 3.1.000 (2008-6-11)
* @see SetFillColor()
*/
- public function SetTextColorArray($color, $ret=false) {
+ public function setTextColorArray($color, $ret=false) {
return $this->setColorArray('text', $color, $ret);
}
/**
* Defines the color used by the specified type ('draw', 'fill', 'text').
- * @param $type (string) Type of object affected by this color: ('draw', 'fill', 'text').
- * @param $col1 (float) GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).
- * @param $col2 (float) GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).
- * @param $col3 (float) BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).
- * @param $col4 (float) KEY (BLACK) color for CMYK (0-100).
- * @param $ret (boolean) If true do not send the command.
- * @param $name (string) spot color name (if any)
- * @return (string) The PDF command or empty string.
+ * @param string $type Type of object affected by this color: ('draw', 'fill', 'text').
+ * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).
+ * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).
+ * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).
+ * @param float $col4 KEY (BLACK) color for CMYK (0-100).
+ * @param boolean $ret If true do not send the command.
+ * @param string $name spot color name (if any)
+ * @return string The PDF command or empty string.
* @public
* @since 5.9.125 (2011-10-03)
*/
@@ -3980,7 +4037,7 @@ class TCPDF {
}
}
$this->ColorFlag = ($this->FillColor != $this->TextColor);
- if (($type != 'text') AND ($this->state == 2)) {
+ if (($type != 'text') AND ($this->state == 2) AND $type !== 0) {
if (!$ret) {
$this->_out($pdfcolor);
}
@@ -3991,63 +4048,63 @@ class TCPDF {
/**
* Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.
- * @param $col1 (float) GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).
- * @param $col2 (float) GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).
- * @param $col3 (float) BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).
- * @param $col4 (float) KEY (BLACK) color for CMYK (0-100).
- * @param $ret (boolean) If true do not send the command.
- * @param $name (string) spot color name (if any)
+ * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).
+ * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).
+ * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).
+ * @param float $col4 KEY (BLACK) color for CMYK (0-100).
+ * @param boolean $ret If true do not send the command.
+ * @param string $name spot color name (if any)
* @return string the PDF command
* @public
* @since 1.3
* @see SetDrawColorArray(), SetFillColor(), SetTextColor(), Line(), Rect(), Cell(), MultiCell()
*/
- public function SetDrawColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') {
+ public function setDrawColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') {
return $this->setColor('draw', $col1, $col2, $col3, $col4, $ret, $name);
}
/**
* Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.
- * @param $col1 (float) GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).
- * @param $col2 (float) GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).
- * @param $col3 (float) BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).
- * @param $col4 (float) KEY (BLACK) color for CMYK (0-100).
- * @param $ret (boolean) If true do not send the command.
- * @param $name (string) Spot color name (if any).
- * @return (string) The PDF command.
+ * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).
+ * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).
+ * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).
+ * @param float $col4 KEY (BLACK) color for CMYK (0-100).
+ * @param boolean $ret If true do not send the command.
+ * @param string $name Spot color name (if any).
+ * @return string The PDF command.
* @public
* @since 1.3
* @see SetFillColorArray(), SetDrawColor(), SetTextColor(), Rect(), Cell(), MultiCell()
*/
- public function SetFillColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') {
+ public function setFillColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') {
return $this->setColor('fill', $col1, $col2, $col3, $col4, $ret, $name);
}
/**
* Defines the color used for text. It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.
- * @param $col1 (float) GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).
- * @param $col2 (float) GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).
- * @param $col3 (float) BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).
- * @param $col4 (float) KEY (BLACK) color for CMYK (0-100).
- * @param $ret (boolean) If true do not send the command.
- * @param $name (string) Spot color name (if any).
- * @return (string) Empty string.
+ * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).
+ * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).
+ * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).
+ * @param float $col4 KEY (BLACK) color for CMYK (0-100).
+ * @param boolean $ret If true do not send the command.
+ * @param string $name Spot color name (if any).
+ * @return string Empty string.
* @public
* @since 1.3
* @see SetTextColorArray(), SetDrawColor(), SetFillColor(), Text(), Cell(), MultiCell()
*/
- public function SetTextColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') {
+ public function setTextColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') {
return $this->setColor('text', $col1, $col2, $col3, $col4, $ret, $name);
}
/**
* Returns the length of a string in user unit. A font must be selected.
- * @param $s (string) The string whose length is to be computed
- * @param $fontname (string) Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained.
- * @param $fontstyle (string) Font style. Possible values are (case insensitive):
empty string: regular
B: bold
I: italic
U: underline
D: line-through
O: overline
or any combination. The default value is regular.
- * @param $fontsize (float) Font size in points. The default value is the current size.
- * @param $getarray (boolean) if true returns an array of characters widths, if false returns the total length.
- * @return mixed int total string length or array of characted widths
+ * @param string $s The string whose length is to be computed
+ * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained.
+ * @param string $fontstyle Font style. Possible values are (case insensitive):
empty string: regular
B: bold
I: italic
U: underline
D: line-through
O: overline
or any combination. The default value is regular.
+ * @param float $fontsize Font size in points. The default value is the current size.
+ * @param boolean $getarray if true returns an array of characters widths, if false returns the total length.
+ * @return float[]|float total string length or array of characted widths
* @author Nicola Asuni
* @public
* @since 1.2
@@ -4058,12 +4115,12 @@ class TCPDF {
/**
* Returns the string length of an array of chars in user unit or an array of characters widths. A font must be selected.
- * @param $sa (string) The array of chars whose total length is to be computed
- * @param $fontname (string) Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained.
- * @param $fontstyle (string) Font style. Possible values are (case insensitive):
empty string: regular
B: bold
I: italic
U: underline
D: line through
O: overline
or any combination. The default value is regular.
- * @param $fontsize (float) Font size in points. The default value is the current size.
- * @param $getarray (boolean) if true returns an array of characters widths, if false returns the total length.
- * @return mixed int total string length or array of characted widths
+ * @param array $sa The array of chars whose total length is to be computed
+ * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained.
+ * @param string $fontstyle Font style. Possible values are (case insensitive):
empty string: regular
B: bold
I: italic
U: underline
D: line through
O: overline
or any combination. The default value is regular.
+ * @param float $fontsize Font size in points. The default value is the current size.
+ * @param boolean $getarray if true returns an array of characters widths, if false returns the total length.
+ * @return float[]|float total string length or array of characted widths
* @author Nicola Asuni
* @public
* @since 2.4.000 (2008-03-06)
@@ -4074,7 +4131,7 @@ class TCPDF {
$prev_FontFamily = $this->FontFamily;
$prev_FontStyle = $this->FontStyle;
$prev_FontSizePt = $this->FontSizePt;
- $this->SetFont($fontname, $fontstyle, $fontsize, '', 'default', false);
+ $this->setFont($fontname, $fontstyle, $fontsize, '', 'default', false);
}
// convert UTF-8 array to Latin1 if required
if ($this->isunicode AND (!$this->isUnicodeFont())) {
@@ -4090,7 +4147,7 @@ class TCPDF {
}
// restore previous values
if (!TCPDF_STATIC::empty_string($fontname)) {
- $this->SetFont($prev_FontFamily, $prev_FontStyle, $prev_FontSizePt, '', 'default', false);
+ $this->setFont($prev_FontFamily, $prev_FontStyle, $prev_FontSizePt, '', 'default', false);
}
if ($getarray) {
return $wa;
@@ -4100,8 +4157,8 @@ class TCPDF {
/**
* Returns the length of the char in user unit for the current font considering current stretching and spacing (tracking).
- * @param $char (int) The char code whose length is to be returned
- * @param $notlast (boolean) If false ignore the font-spacing.
+ * @param int $char The char code whose length is to be returned
+ * @param boolean $notlast If false ignore the font-spacing.
* @return float char width
* @author Nicola Asuni
* @public
@@ -4123,7 +4180,7 @@ class TCPDF {
/**
* Returns the length of the char in user unit for the current font.
- * @param $char (int) The char code whose length is to be returned
+ * @param int $char The char code whose length is to be returned
* @return float char width
* @author Nicola Asuni
* @public
@@ -4134,8 +4191,8 @@ class TCPDF {
// SHY character will not be printed
return (0);
}
- if (isset($this->CurrentFont['cw'][$char])) {
- $w = $this->CurrentFont['cw'][$char];
+ if (isset($this->CurrentFont['cw'][intval($char)])) {
+ $w = $this->CurrentFont['cw'][intval($char)];
} elseif (isset($this->CurrentFont['dw'])) {
// default width
$w = $this->CurrentFont['dw'];
@@ -4150,7 +4207,7 @@ class TCPDF {
/**
* Returns the numbero of characters in a string.
- * @param $s (string) The input string.
+ * @param string $s The input string.
* @return int number of characters
* @public
* @since 2.0.0001 (2008-01-07)
@@ -4182,11 +4239,11 @@ class TCPDF {
* Imports a TrueType, Type1, core, or CID0 font and makes it available.
* It is necessary to generate a font definition file first (read /fonts/utils/README.TXT).
* The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated.
- * @param $family (string) Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font.
- * @param $style (string) Font style. Possible values are (case insensitive):
empty string: regular (default)
B: bold
I: italic
BI or IB: bold italic
- * @param $fontfile (string) The font definition file. By default, the name is built from the family and style, in lower case with no spaces.
- * @return array containing the font data, or false in case of error.
- * @param $subset (mixed) if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font.
+ * @param string $family Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font.
+ * @param string $style Font style. Possible values are (case insensitive):
empty string: regular (default)
B: bold
I: italic
BI or IB: bold italic
+ * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces.
+ * @return array|false array containing the font data, or false in case of error.
+ * @param mixed $subset if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font.
* @public
* @since 1.5
* @see SetFont(), setFontSubsetting()
@@ -4436,18 +4493,18 @@ class TCPDF {
* The method can be called before the first page is created and the font is retained from page to page.
* If you just wish to change the current font size, it is simpler to call SetFontSize().
* Note: for the standard fonts, the font metric files must be accessible. There are three possibilities for this:
They are in the current directory (the one where the running script lies)
They are in one of the directories defined by the include_path parameter
They are in the directory defined by the K_PATH_FONTS constant
- * @param $family (string) Family font. It can be either a name defined by AddFont() or one of the standard Type1 families (case insensitive):
times (Times-Roman)
timesb (Times-Bold)
timesi (Times-Italic)
timesbi (Times-BoldItalic)
helvetica (Helvetica)
helveticab (Helvetica-Bold)
helveticai (Helvetica-Oblique)
helveticabi (Helvetica-BoldOblique)
courier (Courier)
courierb (Courier-Bold)
courieri (Courier-Oblique)
courierbi (Courier-BoldOblique)
symbol (Symbol)
zapfdingbats (ZapfDingbats)
It is also possible to pass an empty string. In that case, the current family is retained.
- * @param $style (string) Font style. Possible values are (case insensitive):
empty string: regular
B: bold
I: italic
U: underline
D: line through
O: overline
or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined.
- * @param $size (float) Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12
- * @param $fontfile (string) The font definition file. By default, the name is built from the family and style, in lower case with no spaces.
- * @param $subset (mixed) if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font.
- * @param $out (boolean) if true output the font size command, otherwise only set the font properties.
+ * @param string $family Family font. It can be either a name defined by AddFont() or one of the standard Type1 families (case insensitive):
times (Times-Roman)
timesb (Times-Bold)
timesi (Times-Italic)
timesbi (Times-BoldItalic)
helvetica (Helvetica)
helveticab (Helvetica-Bold)
helveticai (Helvetica-Oblique)
helveticabi (Helvetica-BoldOblique)
courier (Courier)
courierb (Courier-Bold)
courieri (Courier-Oblique)
courierbi (Courier-BoldOblique)
symbol (Symbol)
zapfdingbats (ZapfDingbats)
It is also possible to pass an empty string. In that case, the current family is retained.
+ * @param string $style Font style. Possible values are (case insensitive):
empty string: regular
B: bold
I: italic
U: underline
D: line through
O: overline
or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined.
+ * @param float|null $size Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12
+ * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces.
+ * @param mixed $subset if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font.
+ * @param boolean $out if true output the font size command, otherwise only set the font properties.
* @author Nicola Asuni
* @public
* @since 1.0
* @see AddFont(), SetFontSize()
*/
- public function SetFont($family, $style='', $size=null, $fontfile='', $subset='default', $out=true) {
+ public function setFont($family, $style='', $size=null, $fontfile='', $subset='default', $out=true) {
//Select a font; size given in points
if ($size === null) {
$size = $this->FontSizePt;
@@ -4464,18 +4521,18 @@ class TCPDF {
$this->setFontSubBuffer($this->CurrentFont['fontkey'], 'subsetchars', $this->CurrentFont['subsetchars']);
}
$this->CurrentFont = $this->getFontBuffer($fontdata['fontkey']);
- $this->SetFontSize($size, $out);
+ $this->setFontSize($size, $out);
}
/**
* Defines the size of the current font.
- * @param $size (float) The font size in points.
- * @param $out (boolean) if true output the font size command, otherwise only set the font properties.
+ * @param float $size The font size in points.
+ * @param boolean $out if true output the font size command, otherwise only set the font properties.
* @public
* @since 1.0
* @see SetFont()
*/
- public function SetFontSize($size, $out=true) {
+ public function setFontSize($size, $out=true) {
$size = (float)$size;
// font size in points
$this->FontSizePt = $size;
@@ -4551,7 +4608,7 @@ class TCPDF {
/**
* Convert a relative font measure into absolute value.
- * @param $s (int) Font measure.
+ * @param int $s Font measure.
* @return float Absolute measure.
* @since 5.9.186 (2012-09-13)
*/
@@ -4561,8 +4618,8 @@ class TCPDF {
/**
* Returns the glyph bounding box of the specified character in the current font in user units.
- * @param $char (int) Input character code.
- * @return mixed array(xMin, yMin, xMax, yMax) or FALSE if not defined.
+ * @param int $char Input character code.
+ * @return false|array array(xMin, yMin, xMax, yMax) or FALSE if not defined.
* @since 5.9.186 (2012-09-13)
*/
public function getCharBBox($char) {
@@ -4580,9 +4637,9 @@ class TCPDF {
/**
* Return the font descent value
- * @param $font (string) font name
- * @param $style (string) font style
- * @param $size (float) The size (in points)
+ * @param string $font font name
+ * @param string $style font style
+ * @param float $size The size (in points)
* @return int font descent
* @public
* @author Nicola Asuni
@@ -4601,9 +4658,9 @@ class TCPDF {
/**
* Return the font ascent value.
- * @param $font (string) font name
- * @param $style (string) font style
- * @param $size (float) The size (in points)
+ * @param string $font font name
+ * @param string $style font style
+ * @param float $size The size (in points)
* @return int font ascent
* @public
* @author Nicola Asuni
@@ -4622,10 +4679,10 @@ class TCPDF {
/**
* Return true in the character is present in the specified font.
- * @param $char (mixed) Character to check (integer value or string)
- * @param $font (string) Font name (family name).
- * @param $style (string) Font style.
- * @return (boolean) true if the char is defined, false otherwise.
+ * @param mixed $char Character to check (integer value or string)
+ * @param string $font Font name (family name).
+ * @param string $style Font style.
+ * @return bool true if the char is defined, false otherwise.
* @public
* @since 5.9.153 (2012-03-28)
*/
@@ -4648,11 +4705,11 @@ class TCPDF {
/**
* Replace missing font characters on selected font with specified substitutions.
- * @param $text (string) Text to process.
- * @param $font (string) Font name (family name).
- * @param $style (string) Font style.
- * @param $subs (array) Array of possible character substitutions. The key is the character to check (integer value) and the value is a single intege value or an array of possible substitutes.
- * @return (string) Processed text.
+ * @param string $text Text to process.
+ * @param string $font Font name (family name).
+ * @param string $style Font style.
+ * @param array $subs Array of possible character substitutions. The key is the character to check (integer value) and the value is a single intege value or an array of possible substitutes.
+ * @return string Processed text.
* @public
* @since 5.9.153 (2012-03-28)
*/
@@ -4689,11 +4746,11 @@ class TCPDF {
/**
* Defines the default monospaced font.
- * @param $font (string) Font name.
+ * @param string $font Font name.
* @public
* @since 4.5.025
*/
- public function SetDefaultMonospacedFont($font) {
+ public function setDefaultMonospacedFont($font) {
$this->default_monospaced_font = $font;
}
@@ -4713,14 +4770,14 @@ class TCPDF {
/**
* Defines the page and position a link points to.
- * @param $link (int) The link identifier returned by AddLink()
- * @param $y (float) Ordinate of target position; -1 indicates the current position. The default value is 0 (top of page)
- * @param $page (int|string) Number of target page; -1 indicates the current page (default value). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.
+ * @param int $link The link identifier returned by AddLink()
+ * @param float $y Ordinate of target position; -1 indicates the current position. The default value is 0 (top of page)
+ * @param int|string $page Number of target page; -1 indicates the current page (default value). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.
* @public
* @since 1.5
* @see AddLink()
*/
- public function SetLink($link, $y=0, $page=-1) {
+ public function setLink($link, $y=0, $page=-1) {
$fixed = false;
if (!empty($page) AND (substr($page, 0, 1) == '*')) {
$page = intval(substr($page, 1));
@@ -4739,12 +4796,12 @@ class TCPDF {
/**
* Puts a link on a rectangular area of the page.
* Text or image links are generally put via Cell(), Write() or Image(), but this method can be useful for instance to define a clickable area inside an image.
- * @param $x (float) Abscissa of the upper-left corner of the rectangle
- * @param $y (float) Ordinate of the upper-left corner of the rectangle
- * @param $w (float) Width of the rectangle
- * @param $h (float) Height of the rectangle
- * @param $link (mixed) URL or identifier returned by AddLink()
- * @param $spaces (int) number of spaces on the text to link
+ * @param float $x Abscissa of the upper-left corner of the rectangle
+ * @param float $y Ordinate of the upper-left corner of the rectangle
+ * @param float $w Width of the rectangle
+ * @param float $h Height of the rectangle
+ * @param mixed $link URL or identifier returned by AddLink()
+ * @param int $spaces number of spaces on the text to link
* @public
* @since 1.5
* @see AddLink(), Annotation(), Cell(), Write(), Image()
@@ -4756,13 +4813,13 @@ class TCPDF {
/**
* Puts a markup annotation on a rectangular area of the page.
* !!!!THE ANNOTATION SUPPORT IS NOT YET FULLY IMPLEMENTED !!!!
- * @param $x (float) Abscissa of the upper-left corner of the rectangle
- * @param $y (float) Ordinate of the upper-left corner of the rectangle
- * @param $w (float) Width of the rectangle
- * @param $h (float) Height of the rectangle
- * @param $text (string) annotation text or alternate content
- * @param $opt (array) array of options (see section 8.4 of PDF reference 1.7).
- * @param $spaces (int) number of spaces on the text to link
+ * @param float $x Abscissa of the upper-left corner of the rectangle
+ * @param float $y Ordinate of the upper-left corner of the rectangle
+ * @param float $w Width of the rectangle
+ * @param float $h Height of the rectangle
+ * @param string $text annotation text or alternate content
+ * @param array $opt array of options (see section 8.4 of PDF reference 1.7).
+ * @param int $spaces number of spaces on the text to link
* @public
* @since 4.0.018 (2008-08-06)
*/
@@ -4863,7 +4920,7 @@ class TCPDF {
}
reset($this->embeddedfiles);
foreach ($this->embeddedfiles as $filename => $filedata) {
- $data = TCPDF_STATIC::fileGetContents($filedata['file']);
+ $data = $this->getCachedFileContents($filedata['file']);
if ($data !== FALSE) {
$rawsize = strlen($data);
if ($rawsize > 0) {
@@ -4902,31 +4959,31 @@ class TCPDF {
/**
* Prints a text cell at the specified position.
* This method allows to place a string precisely on the page.
- * @param $x (float) Abscissa of the cell origin
- * @param $y (float) Ordinate of the cell origin
- * @param $txt (string) String to print
- * @param $fstroke (int) outline size in user units (false = disable)
- * @param $fclip (boolean) if true activate clipping mode (you must call StartTransform() before this function and StopTransform() to stop the clipping tranformation).
- * @param $ffill (boolean) if true fills the text
- * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
- * @param $ln (int) Indicates where the current position should go after the call. Possible values are:
0: to the right (or left for RTL languages)
1: to the beginning of the next line
2: below
Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
- * @param $align (string) Allows to center or align the text. Possible values are:
L or empty string: left align (default value)
C: center
R: right align
J: justify
- * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false).
- * @param $link (mixed) URL or identifier returned by AddLink().
- * @param $stretch (int) font stretch mode:
0 = disabled
1 = horizontal scaling only if text is larger than cell width
2 = forced horizontal scaling to fit cell width
3 = character spacing only if text is larger than cell width
4 = forced character spacing to fit cell width
General font stretching and scaling values will be preserved when possible.
- * @param $ignore_min_height (boolean) if true ignore automatic minimum height value.
- * @param $calign (string) cell vertical alignment relative to the specified Y value. Possible values are:
T : cell top
A : font top
L : font baseline
D : font bottom
B : cell bottom
- * @param $valign (string) text vertical alignment inside the cell. Possible values are:
T : top
C : center
B : bottom
- * @param $rtloff (boolean) if true uses the page top-left corner as origin of axis for $x and $y initial position.
+ * @param float $x Abscissa of the cell origin
+ * @param float $y Ordinate of the cell origin
+ * @param string $txt String to print
+ * @param int $fstroke outline size in user units (0 = disable)
+ * @param boolean $fclip if true activate clipping mode (you must call StartTransform() before this function and StopTransform() to stop the clipping tranformation).
+ * @param boolean $ffill if true fills the text
+ * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * @param int $ln Indicates where the current position should go after the call. Possible values are:
0: to the right (or left for RTL languages)
1: to the beginning of the next line
2: below
Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
+ * @param string $align Allows to center or align the text. Possible values are:
L or empty string: left align (default value)
C: center
R: right align
J: justify
+ * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false).
+ * @param mixed $link URL or identifier returned by AddLink().
+ * @param int $stretch font stretch mode:
0 = disabled
1 = horizontal scaling only if text is larger than cell width
2 = forced horizontal scaling to fit cell width
3 = character spacing only if text is larger than cell width
4 = forced character spacing to fit cell width
General font stretching and scaling values will be preserved when possible.
+ * @param boolean $ignore_min_height if true ignore automatic minimum height value.
+ * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:
T : cell top
A : font top
L : font baseline
D : font bottom
B : cell bottom
+ * @param string $valign text vertical alignment inside the cell. Possible values are:
T : top
C : center
B : bottom
+ * @param boolean $rtloff if true uses the page top-left corner as origin of axis for $x and $y initial position.
* @public
* @since 1.0
* @see Cell(), Write(), MultiCell(), WriteHTML(), WriteHTMLCell()
*/
- public function Text($x, $y, $txt, $fstroke=false, $fclip=false, $ffill=true, $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M', $rtloff=false) {
+ public function Text($x, $y, $txt, $fstroke=0, $fclip=false, $ffill=true, $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M', $rtloff=false) {
$textrendermode = $this->textrendermode;
$textstrokewidth = $this->textstrokewidth;
$this->setTextRenderingMode($fstroke, $ffill, $fclip);
- $this->SetXY($x, $y, $rtloff);
+ $this->setXY($x, $y, $rtloff);
$this->Cell(0, 0, $txt, $border, $ln, $align, $fill, $link, $stretch, $ignore_min_height, $calign, $valign);
// restore previous rendering mode
$this->textrendermode = $textrendermode;
@@ -4937,7 +4994,7 @@ class TCPDF {
* Whenever a page break condition is met, the method is called, and the break is issued or not depending on the returned value.
* The default implementation returns a value according to the mode selected by SetAutoPageBreak().
* This method is called automatically and should not be called directly by the application.
- * @return boolean
+ * @return bool
* @public
* @since 1.4
* @see SetAutoPageBreak()
@@ -4962,14 +5019,14 @@ class TCPDF {
/**
* Add page if needed.
- * @param $h (float) Cell height. Default value: 0.
- * @param $y (mixed) starting y position, leave empty for current position.
- * @param $addpage (boolean) if true add a page, otherwise only return the true/false state
- * @return boolean true in case of page break, false otherwise.
+ * @param float $h Cell height. Default value: 0.
+ * @param float|null $y starting y position, leave empty for current position.
+ * @param bool $addpage if true add a page, otherwise only return the true/false state
+ * @return bool true in case of page break, false otherwise.
* @since 3.2.000 (2008-07-01)
* @protected
*/
- protected function checkPageBreak($h=0, $y='', $addpage=true) {
+ protected function checkPageBreak($h=0, $y=null, $addpage=true) {
if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
@@ -5007,18 +5064,18 @@ class TCPDF {
/**
* Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
* If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.
- * @param $w (float) Cell width. If 0, the cell extends up to the right margin.
- * @param $h (float) Cell height. Default value: 0.
- * @param $txt (string) String to print. Default value: empty string.
- * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
- * @param $ln (int) Indicates where the current position should go after the call. Possible values are:
0: to the right (or left for RTL languages)
1: to the beginning of the next line
2: below
Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
- * @param $align (string) Allows to center or align the text. Possible values are:
L or empty string: left align (default value)
C: center
R: right align
J: justify
- * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false).
- * @param $link (mixed) URL or identifier returned by AddLink().
- * @param $stretch (int) font stretch mode:
0 = disabled
1 = horizontal scaling only if text is larger than cell width
2 = forced horizontal scaling to fit cell width
3 = character spacing only if text is larger than cell width
4 = forced character spacing to fit cell width
General font stretching and scaling values will be preserved when possible.
- * @param $ignore_min_height (boolean) if true ignore automatic minimum height value.
- * @param $calign (string) cell vertical alignment relative to the specified Y value. Possible values are:
T : cell top
C : center
B : cell bottom
A : font top
L : font baseline
D : font bottom
- * @param $valign (string) text vertical alignment inside the cell. Possible values are:
T : top
C : center
B : bottom
+ * @param float $w Cell width. If 0, the cell extends up to the right margin.
+ * @param float $h Cell height. Default value: 0.
+ * @param string $txt String to print. Default value: empty string.
+ * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * @param int $ln Indicates where the current position should go after the call. Possible values are:
0: to the right (or left for RTL languages)
1: to the beginning of the next line
2: below
Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
+ * @param string $align Allows to center or align the text. Possible values are:
L or empty string: left align (default value)
C: center
R: right align
J: justify
+ * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false).
+ * @param mixed $link URL or identifier returned by AddLink().
+ * @param int $stretch font stretch mode:
0 = disabled
1 = horizontal scaling only if text is larger than cell width
2 = forced horizontal scaling to fit cell width
3 = character spacing only if text is larger than cell width
4 = forced character spacing to fit cell width
General font stretching and scaling values will be preserved when possible.
+ * @param boolean $ignore_min_height if true ignore automatic minimum height value.
+ * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:
T : cell top
C : center
B : cell bottom
A : font top
L : font baseline
D : font bottom
+ * @param string $valign text vertical alignment inside the cell. Possible values are:
T : top
C : center
B : bottom
* @public
* @since 1.0
* @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), AddLink(), Ln(), MultiCell(), Write(), SetAutoPageBreak()
@@ -5046,9 +5103,9 @@ class TCPDF {
// print shadow
$this->x += $this->txtshadow['depth_w'];
$this->y += $this->txtshadow['depth_h'];
- $this->SetFillColorArray($this->txtshadow['color']);
- $this->SetTextColorArray($this->txtshadow['color']);
- $this->SetDrawColorArray($this->txtshadow['color']);
+ $this->setFillColorArray($this->txtshadow['color']);
+ $this->setTextColorArray($this->txtshadow['color']);
+ $this->setDrawColorArray($this->txtshadow['color']);
if ($this->txtshadow['opacity'] != $alpha['CA']) {
$this->setAlpha($this->txtshadow['opacity'], $this->txtshadow['blend_mode']);
}
@@ -5058,9 +5115,9 @@ class TCPDF {
//restore data
$this->x = $x;
$this->y = $y;
- $this->SetFillColorArray($bc);
- $this->SetTextColorArray($fc);
- $this->SetDrawColorArray($sc);
+ $this->setFillColorArray($bc);
+ $this->setTextColorArray($fc);
+ $this->setDrawColorArray($sc);
if ($this->txtshadow['opacity'] != $alpha['CA']) {
$this->setAlpha($alpha['CA'], $alpha['BM'], $alpha['ca'], $alpha['AIS']);
}
@@ -5075,18 +5132,18 @@ class TCPDF {
/**
* Returns the PDF string code to print a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
* If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.
- * @param $w (float) Cell width. If 0, the cell extends up to the right margin.
- * @param $h (float) Cell height. Default value: 0.
- * @param $txt (string) String to print. Default value: empty string.
- * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
- * @param $ln (int) Indicates where the current position should go after the call. Possible values are:
0: to the right (or left for RTL languages)
1: to the beginning of the next line
2: below
Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
- * @param $align (string) Allows to center or align the text. Possible values are:
L or empty string: left align (default value)
C: center
R: right align
J: justify
- * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false).
- * @param $link (mixed) URL or identifier returned by AddLink().
- * @param $stretch (int) font stretch mode:
0 = disabled
1 = horizontal scaling only if text is larger than cell width
2 = forced horizontal scaling to fit cell width
3 = character spacing only if text is larger than cell width
4 = forced character spacing to fit cell width
General font stretching and scaling values will be preserved when possible.
- * @param $ignore_min_height (boolean) if true ignore automatic minimum height value.
- * @param $calign (string) cell vertical alignment relative to the specified Y value. Possible values are:
T : cell top
C : center
B : cell bottom
A : font top
L : font baseline
D : font bottom
- * @param $valign (string) text vertical alignment inside the cell. Possible values are:
T : top
M : middle
B : bottom
+ * @param float $w Cell width. If 0, the cell extends up to the right margin.
+ * @param float $h Cell height. Default value: 0.
+ * @param string $txt String to print. Default value: empty string.
+ * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * @param int $ln Indicates where the current position should go after the call. Possible values are:
0: to the right (or left for RTL languages)
1: to the beginning of the next line
2: below
Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
+ * @param string $align Allows to center or align the text. Possible values are:
L or empty string: left align (default value)
C: center
R: right align
J: justify
+ * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false).
+ * @param mixed $link URL or identifier returned by AddLink().
+ * @param int $stretch font stretch mode:
0 = disabled
1 = horizontal scaling only if text is larger than cell width
2 = forced horizontal scaling to fit cell width
3 = character spacing only if text is larger than cell width
4 = forced character spacing to fit cell width
General font stretching and scaling values will be preserved when possible.
+ * @param boolean $ignore_min_height if true ignore automatic minimum height value.
+ * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:
T : cell top
C : center
B : cell bottom
A : font top
L : font baseline
D : font bottom
+ * @param string $valign text vertical alignment inside the cell. Possible values are:
T : top
M : middle
B : bottom
* @return string containing cell code
* @protected
* @since 1.0
@@ -5554,8 +5611,8 @@ class TCPDF {
/**
* Replace a char if is defined on the current font.
- * @param $oldchar (int) Integer code (unicode) of the character to replace.
- * @param $newchar (int) Integer code (unicode) of the new character.
+ * @param int $oldchar Integer code (unicode) of the character to replace.
+ * @param int $newchar Integer code (unicode) of the new character.
* @return int the replaced char or the old char in case the new char i not defined
* @protected
* @since 5.9.167 (2012-06-22)
@@ -5573,11 +5630,11 @@ class TCPDF {
/**
* Returns the code to draw the cell border
- * @param $x (float) X coordinate.
- * @param $y (float) Y coordinate.
- * @param $w (float) Cell width.
- * @param $h (float) Cell height.
- * @param $brd (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * @param float $x X coordinate.
+ * @param float $y Y coordinate.
+ * @param float $w Cell width.
+ * @param float $h Cell height.
+ * @param string|array|int $brd Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
* @return string containing cell border code
* @protected
* @see SetLineStyle()
@@ -5625,7 +5682,7 @@ class TCPDF {
if (is_array($style) AND !empty($style)) {
// apply border style
$prev_style = $this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor.' ';
- $s .= $this->SetLineStyle($style, true)."\n";
+ $s .= $this->setLineStyle($style, true)."\n";
}
switch ($mode) {
case 'ext': {
@@ -5765,28 +5822,28 @@ class TCPDF {
* This method allows printing text with line breaks.
* They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.
* Text can be aligned, centered or justified. The cell block can be framed and the background painted.
- * @param $w (float) Width of cells. If 0, they extend up to the right margin of the page.
- * @param $h (float) Cell minimum height. The cell extends automatically if needed.
- * @param $txt (string) String to print
- * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
- * @param $align (string) Allows to center or align the text. Possible values are:
L or empty string: left align
C: center
R: right align
J: justification (default value when $ishtml=false)
- * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false).
- * @param $ln (int) Indicates where the current position should go after the call. Possible values are:
0: to the right
1: to the beginning of the next line [DEFAULT]
2: below
- * @param $x (float) x position in user units
- * @param $y (float) y position in user units
- * @param $reseth (boolean) if true reset the last cell height (default true).
- * @param $stretch (int) font stretch mode:
0 = disabled
1 = horizontal scaling only if text is larger than cell width
2 = forced horizontal scaling to fit cell width
3 = character spacing only if text is larger than cell width
4 = forced character spacing to fit cell width
General font stretching and scaling values will be preserved when possible.
- * @param $ishtml (boolean) INTERNAL USE ONLY -- set to true if $txt is HTML content (default = false). Never set this parameter to true, use instead writeHTMLCell() or writeHTML() methods.
- * @param $autopadding (boolean) if true, uses internal padding and automatically adjust it to account for line width.
- * @param $maxh (float) maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false.
- * @param $valign (string) Vertical alignment of text (requires $maxh = $h > 0). Possible values are:
T: TOP
M: middle
B: bottom
. This feature works only when $ishtml=false and the cell must fit in a single page.
- * @param $fitcell (boolean) if true attempt to fit all the text within the cell by reducing the font size (do not work in HTML mode). $maxh must be greater than 0 and equal to $h.
+ * @param float $w Width of cells. If 0, they extend up to the right margin of the page.
+ * @param float $h Cell minimum height. The cell extends automatically if needed.
+ * @param string $txt String to print
+ * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * @param string $align Allows to center or align the text. Possible values are:
L or empty string: left align
C: center
R: right align
J: justification (default value when $ishtml=false)
+ * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false).
+ * @param int $ln Indicates where the current position should go after the call. Possible values are:
0: to the right
1: to the beginning of the next line [DEFAULT]
2: below
+ * @param float|null $x x position in user units
+ * @param float|null $y y position in user units
+ * @param boolean $reseth if true reset the last cell height (default true).
+ * @param int $stretch font stretch mode:
0 = disabled
1 = horizontal scaling only if text is larger than cell width
2 = forced horizontal scaling to fit cell width
3 = character spacing only if text is larger than cell width
4 = forced character spacing to fit cell width
General font stretching and scaling values will be preserved when possible.
+ * @param boolean $ishtml INTERNAL USE ONLY -- set to true if $txt is HTML content (default = false). Never set this parameter to true, use instead writeHTMLCell() or writeHTML() methods.
+ * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width.
+ * @param float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false.
+ * @param string $valign Vertical alignment of text (requires $maxh = $h > 0). Possible values are:
T: TOP
M: middle
B: bottom
. This feature works only when $ishtml=false and the cell must fit in a single page.
+ * @param boolean $fitcell if true attempt to fit all the text within the cell by reducing the font size (do not work in HTML mode). $maxh must be greater than 0 and equal to $h.
* @return int Return the number of cells or 1 for html mode.
* @public
* @since 1.3
* @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak()
*/
- public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0, $valign='T', $fitcell=false) {
+ public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln=1, $x=null, $y=null, $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0, $valign='T', $fitcell=false) {
$prev_cell_margin = $this->cell_margin;
$prev_cell_padding = $this->cell_padding;
// adjust internal padding
@@ -5801,7 +5858,7 @@ class TCPDF {
$this->resetLastH();
}
if (!TCPDF_STATIC::empty_string($y)) {
- $this->SetY($y); // set y in order to convert negative y values to positive ones
+ $this->setY($y); // set y in order to convert negative y values to positive ones
}
$y = $this->GetY();
$resth = 0;
@@ -5816,7 +5873,7 @@ class TCPDF {
// get current column
$startcolumn = $this->current_column;
if (!TCPDF_STATIC::empty_string($x)) {
- $this->SetX($x);
+ $this->setX($x);
} else {
$x = $this->GetX();
}
@@ -5877,7 +5934,7 @@ class TCPDF {
$maxit = (2 * min(100, max(10, intval($fmax)))); // max number of iterations
while ($maxit >= 0) {
$fmid = (($fmax + $fmin) / 2);
- $this->SetFontSize($fmid, false);
+ $this->setFontSize($fmid, false);
$this->resetLastH();
$text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border);
$diff = ($maxh - $text_height);
@@ -5893,11 +5950,11 @@ class TCPDF {
}
if ($maxit < 0) {
// premature exit, we get the minimum font value to fit the cell
- $this->SetFontSize($fmin);
+ $this->setFontSize($fmin);
$this->resetLastH();
$text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border);
} else {
- $this->SetFontSize($fmid);
+ $this->setFontSize($fmid);
$this->resetLastH();
}
}
@@ -5914,7 +5971,7 @@ class TCPDF {
$nl = $this->Write($this->lasth, $txt, '', 0, $align, true, $stretch, false, true, $maxh, 0, $mc_margin);
if ($fitcell) {
// restore font size
- $this->SetFontSize($prev_FontSizePt);
+ $this->setFontSize($prev_FontSizePt);
}
}
if ($autopadding) {
@@ -5961,7 +6018,7 @@ class TCPDF {
$this->setPage($page);
if ($this->num_columns < 2) {
// single-column mode
- $this->SetX($x);
+ $this->setX($x);
$this->y = $this->tMargin;
}
// account for margin changes
@@ -6123,15 +6180,15 @@ class TCPDF {
}
if ($ln > 0) {
//Go to the beginning of the next line
- $this->SetY($currentY + $mc_margin['B']);
+ $this->setY($currentY + $mc_margin['B']);
if ($ln == 2) {
- $this->SetX($x + $w + $mc_margin['L'] + $mc_margin['R']);
+ $this->setX($x + $w + $mc_margin['L'] + $mc_margin['R']);
}
} else {
// go left or right by case
$this->setPage($startpage);
$this->y = $y;
- $this->SetX($x + $w + $mc_margin['L'] + $mc_margin['R']);
+ $this->setX($x + $w + $mc_margin['L'] + $mc_margin['R']);
}
$this->setContentMark();
$this->cell_padding = $prev_cell_padding;
@@ -6143,18 +6200,18 @@ class TCPDF {
/**
* This method return the estimated number of lines for print a simple text string using Multicell() method.
- * @param $txt (string) String for calculating his height
- * @param $w (float) Width of cells. If 0, they extend up to the right margin of the page.
- * @param $reseth (boolean) if true reset the last cell height (default false).
- * @param $autopadding (boolean) if true, uses internal padding and automatically adjust it to account for line width (default true).
- * @param $cellpadding (float) Internal cell padding, if empty uses default cell padding.
- * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * @param string $txt String for calculating his height
+ * @param float $w Width of cells. If 0, they extend up to the right margin of the page.
+ * @param boolean $reseth if true reset the last cell height (default false).
+ * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width (default true).
+ * @param array|null $cellpadding Internal cell padding, if empty uses default cell padding.
+ * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
* @return float Return the minimal height needed for multicell method for printing the $txt param.
* @author Alexander Escalona Fern\E1ndez, Nicola Asuni
* @public
* @since 4.5.011
*/
- public function getNumLines($txt, $w=0, $reseth=false, $autopadding=true, $cellpadding='', $border=0) {
+ public function getNumLines($txt, $w=0, $reseth=false, $autopadding=true, $cellpadding=null, $border=0) {
if ($txt === NULL) {
return 0;
}
@@ -6237,7 +6294,7 @@ class TCPDF {
* $start_page = $pdf->getPage();
* // call your printing functions with your parameters
* // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * $pdf->MultiCell($w=0, $h=0, $txt, $border=1, $align='L', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);
+ * $pdf->MultiCell($w=0, $h=0, $txt, $border=1, $align='L', $fill=false, $ln=1, $x=null, $y=null, $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);
* // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* // get the new Y
* $end_y = $pdf->GetY();
@@ -6263,17 +6320,17 @@ class TCPDF {
* // restore previous object
* $pdf = $pdf->rollbackTransaction();
*
- * @param $w (float) Width of cells. If 0, they extend up to the right margin of the page.
- * @param $txt (string) String for calculating his height
- * @param $reseth (boolean) if true reset the last cell height (default false).
- * @param $autopadding (boolean) if true, uses internal padding and automatically adjust it to account for line width (default true).
- * @param $cellpadding (float) Internal cell padding, if empty uses default cell padding.
- * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * @param float $w Width of cells. If 0, they extend up to the right margin of the page.
+ * @param string $txt String for calculating his height
+ * @param boolean $reseth if true reset the last cell height (default false).
+ * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width (default true).
+ * @param array|null $cellpadding Internal cell padding, if empty uses default cell padding.
+ * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
* @return float Return the minimal height needed for multicell method for printing the $txt param.
* @author Nicola Asuni, Alexander Escalona Fern\E1ndez
* @public
*/
- public function getStringHeight($w, $txt, $reseth=false, $autopadding=true, $cellpadding='', $border=0) {
+ public function getStringHeight($w, $txt, $reseth=false, $autopadding=true, $cellpadding=null, $border=0) {
// adjust internal padding
$prev_cell_padding = $this->cell_padding;
$prev_lasth = $this->lasth;
@@ -6290,30 +6347,30 @@ class TCPDF {
/**
* This method prints text from the current position.
- * @param $h (float) Line height
- * @param $txt (string) String to print
- * @param $link (mixed) URL or identifier returned by AddLink()
- * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false).
- * @param $align (string) Allows to center or align the text. Possible values are:
L or empty string: left align (default value)
C: center
R: right align
J: justify
- * @param $ln (boolean) if true set cursor at the bottom of the line, otherwise set cursor at the top of the line.
- * @param $stretch (int) font stretch mode:
0 = disabled
1 = horizontal scaling only if text is larger than cell width
2 = forced horizontal scaling to fit cell width
3 = character spacing only if text is larger than cell width
4 = forced character spacing to fit cell width
General font stretching and scaling values will be preserved when possible.
- * @param $firstline (boolean) if true prints only the first line and return the remaining string.
- * @param $firstblock (boolean) if true the string is the starting of a line.
- * @param $maxh (float) maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature.
- * @param $wadj (float) first line width will be reduced by this amount (used in HTML mode).
- * @param $margin (array) margin array of the parent container
+ * @param float $h Line height
+ * @param string $txt String to print
+ * @param mixed $link URL or identifier returned by AddLink()
+ * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false).
+ * @param string $align Allows to center or align the text. Possible values are:
L or empty string: left align (default value)
C: center
R: right align
J: justify
+ * @param boolean $ln if true set cursor at the bottom of the line, otherwise set cursor at the top of the line.
+ * @param int $stretch font stretch mode:
0 = disabled
1 = horizontal scaling only if text is larger than cell width
2 = forced horizontal scaling to fit cell width
3 = character spacing only if text is larger than cell width
4 = forced character spacing to fit cell width
General font stretching and scaling values will be preserved when possible.
+ * @param boolean $firstline if true prints only the first line and return the remaining string.
+ * @param boolean $firstblock if true the string is the starting of a line.
+ * @param float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature.
+ * @param float $wadj first line width will be reduced by this amount (used in HTML mode).
+ * @param array|null $margin margin array of the parent container
* @return mixed Return the number of cells or the remaining string if $firstline = true.
* @public
* @since 1.5
*/
- public function Write($h, $txt, $link='', $fill=false, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0, $wadj=0, $margin='') {
+ public function Write($h, $txt, $link='', $fill=false, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0, $wadj=0, $margin=null) {
// check page for no-write regions and adapt page margins if necessary
list($this->x, $this->y) = $this->checkPageRegions($h, $this->x, $this->y);
if (strlen($txt) == 0) {
// fix empty text
$txt = ' ';
}
- if ($margin === '') {
+ if (!is_array($margin)) {
// set default margins
$margin = $this->cell_margin;
}
@@ -6415,7 +6472,7 @@ class TCPDF {
$w = $linew;
$tmpcellpadding = $this->cell_padding;
if ($maxh == 0) {
- $this->SetCellPadding(0);
+ $this->setCellPadding(0);
}
}
if ($firstblock AND $this->isRTLTextDir()) {
@@ -6489,7 +6546,7 @@ class TCPDF {
// *** very slow ***
$l = $this->GetArrStringWidth(TCPDF_FONTS::utf8Bidi(array_slice($chars, $j, ($i - $j)), '', $this->tmprtl, $this->isunicode, $this->CurrentFont));
} else {
- $l += $this->GetCharWidth($c);
+ $l += $this->GetCharWidth($c, ($i+1 < $nb));
}
if (($l > $wmax) OR (($c == 173) AND (($l + $tmp_shy_replacement_width) >= $wmax))) {
if (($c == 173) AND (($l + $tmp_shy_replacement_width) > $wmax)) {
@@ -6526,7 +6583,7 @@ class TCPDF {
$w = $linew;
$tmpcellpadding = $this->cell_padding;
if ($maxh == 0) {
- $this->SetCellPadding(0);
+ $this->setCellPadding(0);
}
}
if ($firstblock AND $this->isRTLTextDir()) {
@@ -6570,7 +6627,7 @@ class TCPDF {
$w = $linew;
$tmpcellpadding = $this->cell_padding;
if ($maxh == 0) {
- $this->SetCellPadding(0);
+ $this->setCellPadding(0);
}
}
if ($firstblock AND $this->isRTLTextDir()) {
@@ -6618,7 +6675,7 @@ class TCPDF {
$w = $linew;
$tmpcellpadding = $this->cell_padding;
if ($maxh == 0) {
- $this->SetCellPadding(0);
+ $this->setCellPadding(0);
}
}
// print the line
@@ -6671,13 +6728,10 @@ class TCPDF {
switch ($align) {
case 'J':
case 'C': {
- $w = $w;
break;
}
case 'L': {
- if ($this->rtl) {
- $w = $w;
- } else {
+ if (!$this->rtl) {
$w = $l;
}
break;
@@ -6685,8 +6739,6 @@ class TCPDF {
case 'R': {
if ($this->rtl) {
$w = $l;
- } else {
- $w = $w;
}
break;
}
@@ -6712,7 +6764,7 @@ class TCPDF {
$w = $linew;
$tmpcellpadding = $this->cell_padding;
if ($maxh == 0) {
- $this->SetCellPadding(0);
+ $this->setCellPadding(0);
}
}
if ($firstblock AND $this->isRTLTextDir()) {
@@ -6734,7 +6786,7 @@ class TCPDF {
/**
* Returns the remaining width between the current position and margins.
- * @return int Return the remaining width
+ * @return float Return the remaining width
* @protected
*/
protected function getRemainingWidth() {
@@ -6748,12 +6800,12 @@ class TCPDF {
/**
* Set the block dimensions accounting for page breaks and page/column fitting
- * @param $w (float) width
- * @param $h (float) height
- * @param $x (float) X coordinate
- * @param $y (float) Y coodiante
- * @param $fitonpage (boolean) if true the block is resized to not exceed page dimensions.
- * @return array($w, $h, $x, $y)
+ * @param float $w width
+ * @param float $h height
+ * @param float $x X coordinate
+ * @param float $y Y coodiante
+ * @param boolean $fitonpage if true the block is resized to not exceed page dimensions.
+ * @return array array($w, $h, $x, $y)
* @protected
* @since 5.5.009 (2010-07-05)
*/
@@ -6829,43 +6881,49 @@ class TCPDF {
* The format can be specified explicitly or inferred from the file extension.
* It is possible to put a link on the image.
* Remark: if an image is used several times, only one copy will be embedded in the file.
- * @param $file (string) Name of the file containing the image or a '@' character followed by the image data string. To link an image without embedding it on the document, set an asterisk character before the URL (i.e.: '*http://www.example.com/image.jpg').
- * @param $x (float) Abscissa of the upper-left corner (LTR) or upper-right corner (RTL).
- * @param $y (float) Ordinate of the upper-left corner (LTR) or upper-right corner (RTL).
- * @param $w (float) Width of the image in the page. If not specified or equal to zero, it is automatically calculated.
- * @param $h (float) Height of the image in the page. If not specified or equal to zero, it is automatically calculated.
- * @param $type (string) Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension.
- * @param $link (mixed) URL or identifier returned by AddLink().
- * @param $align (string) Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
T: top-right for LTR or top-left for RTL
M: middle-right for LTR or middle-left for RTL
B: bottom-right for LTR or bottom-left for RTL
N: next line
- * @param $resize (mixed) If true resize (reduce) the image to fit $w and $h (requires GD or ImageMagick library); if false do not resize; if 2 force resize in all cases (upscaling and downscaling).
- * @param $dpi (int) dot-per-inch resolution used on resize
- * @param $palign (string) Allows to center or align the image on the current line. Possible values are:
L : left align
C : center
R : right align
'' : empty string : left for LTR or right for RTL
- * @param $ismask (boolean) true if this image is a mask, false otherwise
- * @param $imgmask (mixed) image object returned by this function or false
- * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
- * @param $fitbox (mixed) If not false scale image dimensions proportionally to fit within the ($w, $h) box. $fitbox can be true or a 2 characters string indicating the image alignment inside the box. The first character indicate the horizontal alignment (L = left, C = center, R = right) the second character indicate the vertical algnment (T = top, M = middle, B = bottom).
- * @param $hidden (boolean) If true do not display the image.
- * @param $fitonpage (boolean) If true the image is resized to not exceed page dimensions.
- * @param $alt (boolean) If true the image will be added as alternative and not directly printed (the ID of the image will be returned).
- * @param $altimgs (array) Array of alternate images IDs. Each alternative image must be an array with two values: an integer representing the image ID (the value returned by the Image method) and a boolean value to indicate if the image is the default for printing.
- * @return image information
+ * @param string $file Name of the file containing the image or a '@' character followed by the image data string. To link an image without embedding it on the document, set an asterisk character before the URL (i.e.: '*http://www.example.com/image.jpg').
+ * @param float|null $x Abscissa of the upper-left corner (LTR) or upper-right corner (RTL).
+ * @param float|null $y Ordinate of the upper-left corner (LTR) or upper-right corner (RTL).
+ * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated.
+ * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated.
+ * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension.
+ * @param mixed $link URL or identifier returned by AddLink().
+ * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
T: top-right for LTR or top-left for RTL
M: middle-right for LTR or middle-left for RTL
B: bottom-right for LTR or bottom-left for RTL
N: next line
+ * @param mixed $resize If true resize (reduce) the image to fit $w and $h (requires GD or ImageMagick library); if false do not resize; if 2 force resize in all cases (upscaling and downscaling).
+ * @param int $dpi dot-per-inch resolution used on resize
+ * @param string $palign Allows to center or align the image on the current line. Possible values are:
L : left align
C : center
R : right align
'' : empty string : left for LTR or right for RTL
+ * @param boolean $ismask true if this image is a mask, false otherwise
+ * @param mixed $imgmask image object returned by this function or false
+ * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * @param mixed $fitbox If not false scale image dimensions proportionally to fit within the ($w, $h) box. $fitbox can be true or a 2 characters string indicating the image alignment inside the box. The first character indicate the horizontal alignment (L = left, C = center, R = right) the second character indicate the vertical algnment (T = top, M = middle, B = bottom).
+ * @param boolean $hidden If true do not display the image.
+ * @param boolean $fitonpage If true the image is resized to not exceed page dimensions.
+ * @param boolean $alt If true the image will be added as alternative and not directly printed (the ID of the image will be returned).
+ * @param array $altimgs Array of alternate images IDs. Each alternative image must be an array with two values: an integer representing the image ID (the value returned by the Image method) and a boolean value to indicate if the image is the default for printing.
+ * @return mixed|false image information
* @public
* @since 1.1
*/
- public function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false, $alt=false, $altimgs=array()) {
+ public function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false, $alt=false, $altimgs=array()) {
if ($this->state != 2) {
- return;
+ return false;
}
- if (strcmp($x, '') === 0) {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if (strcmp($y, '') === 0) {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
list($x, $y) = $this->checkPageRegions($h, $x, $y);
$exurl = ''; // external streams
$imsize = FALSE;
+
+ // Make sure the file variable is not empty or null because accessing $file[0] later
+ // results in error when running PHP 7.4
+ if (empty($file)) {
+ return false;
+ }
// check if we are passing an image as file or string
if ($file[0] === '@') {
// image from string
@@ -6877,18 +6935,14 @@ class TCPDF {
$exurl = $file;
}
// check if file exist and it is valid
- if (!@TCPDF_STATIC::file_exists($file)) {
+ if (!@$this->fileExists($file)) {
return false;
}
- if (($imsize = @getimagesize($file)) === FALSE) {
- if (in_array($file, $this->imagekeys)) {
- // get existing image data
- $info = $this->getImageBuffer($file);
- $imsize = array($info['w'], $info['h']);
- } elseif (strpos($file, '__tcpdf_'.$this->file_id.'_img') === FALSE) {
- $imgdata = TCPDF_STATIC::fileGetContents($file);
- }
- }
+ if (false !== $info = $this->getImageBuffer($file)) {
+ $imsize = array($info['w'], $info['h']);
+ } elseif (($imsize = @getimagesize($file)) === FALSE && strpos($file, '__tcpdf_'.$this->file_id.'_img') === FALSE){
+ $imgdata = $this->getCachedFileContents($file);
+ }
}
if (!empty($imgdata)) {
// copy image to cache
@@ -7093,7 +7147,7 @@ class TCPDF {
$svgimg = substr($file, 1);
} else {
// get SVG file content
- $svgimg = TCPDF_STATIC::fileGetContents($file);
+ $svgimg = $this->getCachedFileContents($file);
}
if ($svgimg !== FALSE) {
// get width and height
@@ -7146,7 +7200,7 @@ class TCPDF {
}
if ($info === false) {
// unable to process image
- return;
+ return false;
}
TCPDF_STATIC::set_mqr($mqr);
if ($ismask) {
@@ -7221,7 +7275,7 @@ class TCPDF {
break;
}
case 'N': {
- $this->SetY($this->img_rb_y);
+ $this->setY($this->img_rb_y);
break;
}
default:{
@@ -7238,20 +7292,20 @@ class TCPDF {
/**
* Extract info from a PNG image with alpha channel using the Imagick or GD library.
- * @param $file (string) Name of the file containing the image.
- * @param $x (float) Abscissa of the upper-left corner.
- * @param $y (float) Ordinate of the upper-left corner.
- * @param $wpx (float) Original width of the image in pixels.
- * @param $hpx (float) original height of the image in pixels.
- * @param $w (float) Width of the image in the page. If not specified or equal to zero, it is automatically calculated.
- * @param $h (float) Height of the image in the page. If not specified or equal to zero, it is automatically calculated.
- * @param $type (string) Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension.
- * @param $link (mixed) URL or identifier returned by AddLink().
- * @param $align (string) Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
T: top-right for LTR or top-left for RTL
M: middle-right for LTR or middle-left for RTL
B: bottom-right for LTR or bottom-left for RTL
N: next line
- * @param $resize (boolean) If true resize (reduce) the image to fit $w and $h (requires GD library).
- * @param $dpi (int) dot-per-inch resolution used on resize
- * @param $palign (string) Allows to center or align the image on the current line. Possible values are:
L : left align
C : center
R : right align
'' : empty string : left for LTR or right for RTL
- * @param $filehash (string) File hash used to build unique file names.
+ * @param string $file Name of the file containing the image.
+ * @param float $x Abscissa of the upper-left corner.
+ * @param float $y Ordinate of the upper-left corner.
+ * @param float $wpx Original width of the image in pixels.
+ * @param float $hpx original height of the image in pixels.
+ * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated.
+ * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated.
+ * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension.
+ * @param mixed $link URL or identifier returned by AddLink().
+ * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
T: top-right for LTR or top-left for RTL
M: middle-right for LTR or middle-left for RTL
B: bottom-right for LTR or bottom-left for RTL
N: next line
+ * @param boolean $resize If true resize (reduce) the image to fit $w and $h (requires GD library).
+ * @param int $dpi dot-per-inch resolution used on resize
+ * @param string $palign Allows to center or align the image on the current line. Possible values are:
L : left align
C : center
R : right align
'' : empty string : left for LTR or right for RTL
+ * @param string $filehash File hash used to build unique file names.
* @author Nicola Asuni
* @protected
* @since 4.3.007 (2008-12-04)
@@ -7315,7 +7369,7 @@ class TCPDF {
$color = imagecolorat($img, $xpx, $ypx);
// get and correct gamma color
$alpha = $this->getGDgamma($img, $color);
- imagesetpixel($imgalpha, $xpx, $ypx, $alpha);
+ imagesetpixel($imgalpha, (int) $xpx, (int) $ypx, (int) $alpha);
}
}
imagepng($imgalpha, $tempfile_alpha);
@@ -7346,8 +7400,8 @@ class TCPDF {
/**
* Get the GD-corrected PNG gamma value from alpha color
- * @param $img (int) GD image Resource ID.
- * @param $c (int) alpha color
+ * @param resource $img GD image Resource ID.
+ * @param int $c alpha color
* @protected
* @since 4.3.007 (2008-12-04)
*/
@@ -7355,9 +7409,9 @@ class TCPDF {
if (!isset($this->gdgammacache['#'.$c])) {
$colors = imagecolorsforindex($img, $c);
// GD alpha is only 7 bit (0 -> 127)
- $this->gdgammacache['#'.$c] = (((127 - $colors['alpha']) / 127) * 255);
+ $this->gdgammacache['#'.$c] = (int) (((127 - $colors['alpha']) / 127) * 255);
// correct gamma
- $this->gdgammacache['#'.$c] = (pow(($this->gdgammacache['#'.$c] / 255), 2.2) * 255);
+ $this->gdgammacache['#'.$c] = (int) (pow(($this->gdgammacache['#'.$c] / 255), 2.2) * 255);
// store the latest values on cache to improve performances
if (count($this->gdgammacache) > 8) {
// remove one element from the cache array
@@ -7370,13 +7424,13 @@ class TCPDF {
/**
* Performs a line break.
* The current abscissa goes back to the left margin and the ordinate increases by the amount passed in parameter.
- * @param $h (float) The height of the break. By default, the value equals the height of the last printed cell.
- * @param $cell (boolean) if true add the current left (or right o for RTL) padding to the X coordinate
+ * @param float|null $h The height of the break. By default, the value equals the height of the last printed cell.
+ * @param boolean $cell if true add the current left (or right o for RTL) padding to the X coordinate
* @public
* @since 1.0
* @see Cell()
*/
- public function Ln($h='', $cell=false) {
+ public function Ln($h=null, $cell=false) {
if (($this->num_columns > 1) AND ($this->y == $this->columns[$this->current_column]['y']) AND isset($this->columns[$this->current_column]['x']) AND ($this->x == $this->columns[$this->current_column]['x'])) {
// revove vertical space from the top of the column
return;
@@ -7395,7 +7449,7 @@ class TCPDF {
} else {
$this->x = $this->lMargin + $cellpadding;
}
- if (is_string($h)) {
+ if (TCPDF_STATIC::empty_string($h)) {
$h = $this->lasth;
}
$this->y += $h;
@@ -7444,13 +7498,13 @@ class TCPDF {
/**
* Defines the abscissa of the current position.
* If the passed value is negative, it is relative to the right of the page (or left if language is RTL).
- * @param $x (float) The value of the abscissa in user units.
- * @param $rtloff (boolean) if true always uses the page top-left corner as origin of axis.
+ * @param float $x The value of the abscissa in user units.
+ * @param boolean $rtloff if true always uses the page top-left corner as origin of axis.
* @public
* @since 1.2
* @see GetX(), GetY(), SetY(), SetXY()
*/
- public function SetX($x, $rtloff=false) {
+ public function setX($x, $rtloff=false) {
$x = floatval($x);
if (!$rtloff AND $this->rtl) {
if ($x >= 0) {
@@ -7476,14 +7530,14 @@ class TCPDF {
/**
* Moves the current abscissa back to the left margin and sets the ordinate.
* If the passed value is negative, it is relative to the bottom of the page.
- * @param $y (float) The value of the ordinate in user units.
- * @param $resetx (bool) if true (default) reset the X position.
- * @param $rtloff (boolean) if true always uses the page top-left corner as origin of axis.
+ * @param float $y The value of the ordinate in user units.
+ * @param bool $resetx if true (default) reset the X position.
+ * @param boolean $rtloff if true always uses the page top-left corner as origin of axis.
* @public
* @since 1.0
* @see GetX(), GetY(), SetY(), SetXY()
*/
- public function SetY($y, $resetx=true, $rtloff=false) {
+ public function setY($y, $resetx=true, $rtloff=false) {
$y = floatval($y);
if ($resetx) {
//reset x
@@ -7509,59 +7563,59 @@ class TCPDF {
/**
* Defines the abscissa and ordinate of the current position.
* If the passed values are negative, they are relative respectively to the right and bottom of the page.
- * @param $x (float) The value of the abscissa.
- * @param $y (float) The value of the ordinate.
- * @param $rtloff (boolean) if true always uses the page top-left corner as origin of axis.
+ * @param float $x The value of the abscissa.
+ * @param float $y The value of the ordinate.
+ * @param boolean $rtloff if true always uses the page top-left corner as origin of axis.
* @public
* @since 1.2
* @see SetX(), SetY()
*/
- public function SetXY($x, $y, $rtloff=false) {
- $this->SetY($y, false, $rtloff);
- $this->SetX($x, $rtloff);
+ public function setXY($x, $y, $rtloff=false) {
+ $this->setY($y, false, $rtloff);
+ $this->setX($x, $rtloff);
}
/**
* Set the absolute X coordinate of the current pointer.
- * @param $x (float) The value of the abscissa in user units.
+ * @param float $x The value of the abscissa in user units.
* @public
* @since 5.9.186 (2012-09-13)
* @see setAbsX(), setAbsY(), SetAbsXY()
*/
- public function SetAbsX($x) {
+ public function setAbsX($x) {
$this->x = floatval($x);
}
/**
* Set the absolute Y coordinate of the current pointer.
- * @param $y (float) (float) The value of the ordinate in user units.
+ * @param float $y (float) The value of the ordinate in user units.
* @public
* @since 5.9.186 (2012-09-13)
* @see setAbsX(), setAbsY(), SetAbsXY()
*/
- public function SetAbsY($y) {
+ public function setAbsY($y) {
$this->y = floatval($y);
}
/**
* Set the absolute X and Y coordinates of the current pointer.
- * @param $x (float) The value of the abscissa in user units.
- * @param $y (float) (float) The value of the ordinate in user units.
+ * @param float $x The value of the abscissa in user units.
+ * @param float $y (float) The value of the ordinate in user units.
* @public
* @since 5.9.186 (2012-09-13)
* @see setAbsX(), setAbsY(), SetAbsXY()
*/
- public function SetAbsXY($x, $y) {
- $this->SetAbsX($x);
- $this->SetAbsY($y);
+ public function setAbsXY($x, $y) {
+ $this->setAbsX($x);
+ $this->setAbsY($y);
}
/**
* Send the document to a given destination: string, local file or browser.
* In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
* The method first calls Close() if necessary to terminate the document.
- * @param $name (string) The name of the file when saved. Note that special characters are removed and blanks characters are replaced with the underscore character.
- * @param $dest (string) Destination where to send the document. It can take one of the following values:
I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.
D: send to the browser and force a file download with the name given by name.
F: save to a local server file with the name given by name.
S: return the document as a string (name is ignored).
FI: equivalent to F + I option
FD: equivalent to F + D option
E: return the document as base64 mime multi-part email attachment (RFC 2045)
+ * @param string $name The name of the file when saved. Note that special characters are removed and blanks characters are replaced with the underscore character.
+ * @param string $dest Destination where to send the document. It can take one of the following values:
I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.
D: send to the browser and force a file download with the name given by name.
F: save to a local server file with the name given by name.
S: return the document as a string (name is ignored).
FI: equivalent to F + I option
FD: equivalent to F + D option
E: return the document as base64 mime multi-part email attachment (RFC 2045)
* @return string
* @public
* @since 1.0
@@ -7761,20 +7815,16 @@ class TCPDF {
protected static $cleaned_ids = array();
/**
* Unset all class variables except the following critical variables.
- * @param $destroyall (boolean) if true destroys all class variables, otherwise preserves critical variables.
- * @param $preserve_objcopy (boolean) if true preserves the objcopy variable
+ * @param boolean $destroyall if true destroys all class variables, otherwise preserves critical variables.
+ * @param boolean $preserve_objcopy if true preserves the objcopy variable
* @public
* @since 4.5.016 (2009-02-24)
*/
public function _destroy($destroyall=false, $preserve_objcopy=false) {
- // restore internal encoding
- if (isset($this->internal_encoding) AND !empty($this->internal_encoding)) {
- mb_internal_encoding($this->internal_encoding);
- }
if (isset(self::$cleaned_ids[$this->file_id])) {
$destroyall = false;
}
- if ($destroyall AND !$preserve_objcopy) {
+ if ($destroyall AND !$preserve_objcopy && isset($this->file_id)) {
self::$cleaned_ids[$this->file_id] = true;
// remove all temporary files
if ($handle = @opendir(K_PATH_CACHE)) {
@@ -7787,7 +7837,7 @@ class TCPDF {
}
if (isset($this->imagekeys)) {
foreach($this->imagekeys as $file) {
- if (strpos($file, K_PATH_CACHE) === 0) {
+ if (strpos($file, K_PATH_CACHE) === 0 && TCPDF_STATIC::file_exists($file)) {
@unlink($file);
}
}
@@ -7795,7 +7845,6 @@ class TCPDF {
}
$preserve = array(
'file_id',
- 'internal_encoding',
'state',
'bufferlen',
'buffer',
@@ -7834,7 +7883,7 @@ class TCPDF {
/**
* Return an array containing variations for the basic page number alias.
- * @param $a (string) Base alias.
+ * @param string $a Base alias.
* @return array of page number aliases
* @protected
*/
@@ -7871,10 +7920,10 @@ class TCPDF {
/**
* Replace right shift page number aliases with spaces to correct right alignment.
* This works perfectly only when using monospaced fonts.
- * @param $page (string) Page content.
- * @param $aliases (array) Array of page aliases.
- * @param $diff (int) initial difference to add.
- * @return replaced page content.
+ * @param string $page Page content.
+ * @param array $aliases Array of page aliases.
+ * @param int $diff initial difference to add.
+ * @return string replaced page content.
* @protected
*/
protected function replaceRightShiftPageNumAliases($page, $aliases, $diff) {
@@ -7909,7 +7958,7 @@ class TCPDF {
/**
* Set page boxes to be included on page descriptions.
- * @param $boxes (array) Array of page boxes to set on document: ('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox').
+ * @param array $boxes Array of page boxes to set on document: ('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox').
* @protected
*/
protected function setPageBoxTypes($boxes) {
@@ -8024,7 +8073,7 @@ class TCPDF {
}
$out .= ' /Contents '.($this->n + 1).' 0 R';
$out .= ' /Rotate '.$this->pagedim[$n]['Rotate'];
- if (!$this->pdfa_mode) {
+ if (!$this->pdfa_mode || $this->pdfa_version >= 2) {
$out .= ' /Group << /Type /Group /S /Transparency /CS /DeviceRGB >>';
}
if (isset($this->pagedim[$n]['trans']) AND !empty($this->pagedim[$n]['trans'])) {
@@ -8081,7 +8130,7 @@ class TCPDF {
/**
* Get references to page annotations.
- * @param $n (int) page number
+ * @param int $n page number
* @return string
* @protected
* @author Nicola Asuni
@@ -8379,8 +8428,13 @@ class TCPDF {
} else {
$annots .= ' /Name /Note';
}
+ $hasStateModel = isset($pl['opt']['statemodel']);
+ $hasState = isset($pl['opt']['state']);
$statemodels = array('Marked', 'Review');
- if (isset($pl['opt']['statemodel']) AND in_array($pl['opt']['statemodel'], $statemodels)) {
+ if (!$hasStateModel && !$hasState) {
+ break;
+ }
+ if ($hasStateModel AND in_array($pl['opt']['statemodel'], $statemodels)) {
$annots .= ' /StateModel /'.$pl['opt']['statemodel'];
} else {
$pl['opt']['statemodel'] = 'Marked';
@@ -8391,7 +8445,7 @@ class TCPDF {
} else {
$states = array('Accepted', 'Rejected', 'Cancelled', 'Completed', 'None');
}
- if (isset($pl['opt']['state']) AND in_array($pl['opt']['state'], $states)) {
+ if ($hasState AND in_array($pl['opt']['state'], $states)) {
$annots .= ' /State /'.$pl['opt']['state'];
} else {
if ($pl['opt']['statemodel'] == 'Marked') {
@@ -8406,7 +8460,7 @@ class TCPDF {
if (is_string($pl['txt']) && !empty($pl['txt'])) {
if ($pl['txt'][0] == '#') {
// internal destination
- $annots .= ' /A <>';
+ $annots .= ' /A <>';
} elseif ($pl['txt'][0] == '%') {
// embedded PDF file
$filename = basename(substr($pl['txt'], 1));
@@ -8769,9 +8823,9 @@ class TCPDF {
/**
* Put appearance streams XObject used to define annotation's appearance states.
- * @param $w (int) annotation width
- * @param $h (int) annotation height
- * @param $stream (string) appearance stream
+ * @param int $w annotation width
+ * @param int $h annotation height
+ * @param string $stream appearance stream
* @return int object ID
* @protected
* @since 4.8.001 (2009-09-09)
@@ -8953,7 +9007,7 @@ class TCPDF {
/**
* Adds unicode fonts.
* Based on PDF Reference 1.3 (section 5)
- * @param $font (array) font data
+ * @param array $font font data
* @protected
* @author Nicola Asuni
* @since 1.52.0.TC005 (2005-01-05)
@@ -9057,7 +9111,7 @@ class TCPDF {
/**
* Output CID-0 fonts.
* A Type 0 CIDFont contains glyph descriptions based on the Adobe Type 1 font format
- * @param $font (array) font data
+ * @param array $font font data
* @protected
* @author Andrew Whitehead, Nicola Asuni, Yukihiro Nakadaira
* @since 3.2.000 (2008-06-23)
@@ -9278,7 +9332,7 @@ class TCPDF {
$out .= ' /Matrix [1 0 0 1 0 0]';
$out .= ' /Resources <<';
$out .= ' /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]';
- if (!$this->pdfa_mode) {
+ if (!$this->pdfa_mode || $this->pdfa_version >= 2) {
// transparency
if (isset($data['extgstates']) AND !empty($data['extgstates'])) {
$out .= ' /ExtGState <<';
@@ -9416,7 +9470,7 @@ class TCPDF {
}
$out .= ' >>';
}
- if (!$this->pdfa_mode) {
+ if (!$this->pdfa_mode || $this->pdfa_version >= 2) {
// transparency
if (isset($this->extgstates) AND !empty($this->extgstates)) {
$out .= ' /ExtGState <<';
@@ -9530,7 +9584,7 @@ class TCPDF {
/**
* Set additional XMP data to be added on the default XMP data just before the end of "x:xmpmeta" tag.
* IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method!
- * @param $xmp (string) Custom XMP data.
+ * @param string $xmp Custom XMP data.
* @since 5.9.128 (2011-10-06)
* @public
*/
@@ -9541,7 +9595,7 @@ class TCPDF {
/**
* Set additional XMP data to be added on the default XMP data just before the end of "rdf:RDF" tag.
* IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method!
- * @param $xmp (string) Custom XMP RDF data.
+ * @param string $xmp Custom XMP RDF data.
* @since 6.3.0 (2019-09-19)
* @public
*/
@@ -9551,7 +9605,7 @@ class TCPDF {
/**
* Put XMP data object and return ID.
- * @return (int) The object ID.
+ * @return int The object ID.
* @since 5.9.121 (2011-09-28)
* @protected
*/
@@ -10058,8 +10112,8 @@ class TCPDF {
/**
* Initialize a new page.
- * @param $orientation (string) page orientation. Possible values are (case insensitive):
P or PORTRAIT (default)
L or LANDSCAPE
- * @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().
+ * @param string $orientation page orientation. Possible values are (case insensitive):
P or PORTRAIT (default)
L or LANDSCAPE
+ * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().
* @protected
* @see getPageSizeFromFormat(), setPageFormat()
*/
@@ -10123,13 +10177,13 @@ class TCPDF {
/**
* Return the starting object string for the selected object ID.
- * @param $objid (int) Object ID (leave empty to get a new ID).
+ * @param int|null $objid Object ID (leave empty to get a new ID).
* @return string the starting object string
* @protected
* @since 5.8.009 (2010-08-20)
*/
- protected function _getobj($objid='') {
- if ($objid === '') {
+ protected function _getobj($objid=null) {
+ if (TCPDF_STATIC::empty_string($objid)) {
++$this->n;
$objid = $this->n;
}
@@ -10140,9 +10194,9 @@ class TCPDF {
/**
* Underline text.
- * @param $x (int) X coordinate
- * @param $y (int) Y coordinate
- * @param $txt (string) text to underline
+ * @param int $x X coordinate
+ * @param int $y Y coordinate
+ * @param string $txt text to underline
* @protected
*/
protected function _dounderline($x, $y, $txt) {
@@ -10152,9 +10206,9 @@ class TCPDF {
/**
* Underline for rectangular text area.
- * @param $x (int) X coordinate
- * @param $y (int) Y coordinate
- * @param $w (int) width to underline
+ * @param int $x X coordinate
+ * @param int $y Y coordinate
+ * @param int $w width to underline
* @protected
* @since 4.8.008 (2009-09-29)
*/
@@ -10165,9 +10219,9 @@ class TCPDF {
/**
* Line through text.
- * @param $x (int) X coordinate
- * @param $y (int) Y coordinate
- * @param $txt (string) text to linethrough
+ * @param int $x X coordinate
+ * @param int $y Y coordinate
+ * @param string $txt text to linethrough
* @protected
*/
protected function _dolinethrough($x, $y, $txt) {
@@ -10177,9 +10231,9 @@ class TCPDF {
/**
* Line through for rectangular text area.
- * @param $x (int) X coordinate
- * @param $y (int) Y coordinate
- * @param $w (int) line length (width)
+ * @param int $x X coordinate
+ * @param int $y Y coordinate
+ * @param int $w line length (width)
* @protected
* @since 4.9.008 (2009-09-29)
*/
@@ -10190,9 +10244,9 @@ class TCPDF {
/**
* Overline text.
- * @param $x (int) X coordinate
- * @param $y (int) Y coordinate
- * @param $txt (string) text to overline
+ * @param int $x X coordinate
+ * @param int $y Y coordinate
+ * @param string $txt text to overline
* @protected
* @since 4.9.015 (2010-04-19)
*/
@@ -10203,9 +10257,9 @@ class TCPDF {
/**
* Overline for rectangular text area.
- * @param $x (int) X coordinate
- * @param $y (int) Y coordinate
- * @param $w (int) width to overline
+ * @param int $x X coordinate
+ * @param int $y Y coordinate
+ * @param int $w width to overline
* @protected
* @since 4.9.015 (2010-04-19)
*/
@@ -10217,8 +10271,8 @@ class TCPDF {
/**
* Format a data string for meta information
- * @param $s (string) data string to escape.
- * @param $n (int) object ID
+ * @param string $s data string to escape.
+ * @param int $n object ID
* @return string escaped string.
* @protected
*/
@@ -10232,7 +10286,7 @@ class TCPDF {
/**
* Set the document creation timestamp
- * @param $time (mixed) Document creation timestamp in seconds or date-time string.
+ * @param mixed $time Document creation timestamp in seconds or date-time string.
* @public
* @since 5.9.152 (2012-03-23)
*/
@@ -10245,7 +10299,7 @@ class TCPDF {
/**
* Set the document modification timestamp
- * @param $time (mixed) Document modification timestamp in seconds or date-time string.
+ * @param mixed $time Document modification timestamp in seconds or date-time string.
* @public
* @since 5.9.152 (2012-03-23)
*/
@@ -10258,7 +10312,7 @@ class TCPDF {
/**
* Returns document creation timestamp in seconds.
- * @return (int) Creation timestamp in seconds.
+ * @return int Creation timestamp in seconds.
* @public
* @since 5.9.152 (2012-03-23)
*/
@@ -10268,7 +10322,7 @@ class TCPDF {
/**
* Returns document modification timestamp in seconds.
- * @return (int) Modfication timestamp in seconds.
+ * @return int Modfication timestamp in seconds.
* @public
* @since 5.9.152 (2012-03-23)
*/
@@ -10278,8 +10332,8 @@ class TCPDF {
/**
* Returns a formatted date for meta information
- * @param $n (int) Object ID.
- * @param $timestamp (int) Timestamp to convert.
+ * @param int $n Object ID.
+ * @param int $timestamp Timestamp to convert.
* @return string escaped date string.
* @protected
* @since 4.6.028 (2009-08-25)
@@ -10293,8 +10347,8 @@ class TCPDF {
/**
* Format a text string for meta information
- * @param $s (string) string to escape.
- * @param $n (int) object ID
+ * @param string $s string to escape.
+ * @param int $n object ID
* @return string escaped string.
* @protected
*/
@@ -10308,8 +10362,8 @@ class TCPDF {
/**
* get raw output stream.
- * @param $s (string) string to output.
- * @param $n (int) object reference for encryption mode
+ * @param string $s string to output.
+ * @param int $n object reference for encryption mode
* @protected
* @author Nicola Asuni
* @since 5.5.000 (2010-06-22)
@@ -10324,7 +10378,7 @@ class TCPDF {
/**
* Output a string to the document.
- * @param $s (string) string to output.
+ * @param string $s string to output.
* @protected
*/
protected function _out($s) {
@@ -10352,7 +10406,8 @@ class TCPDF {
/**
* Set header font.
- * @param $font (array) Array describing the basic font parameters: (family, style, size).
+ * @param array $font Array describing the basic font parameters: (family, style, size).
+ * @phpstan-param array{0: string, 1: string, 2: float|null} $font
* @public
* @since 1.1
*/
@@ -10362,7 +10417,8 @@ class TCPDF {
/**
* Get header font.
- * @return array() Array describing the basic font parameters: (family, style, size).
+ * @return array Array describing the basic font parameters: (family, style, size).
+ * @phpstan-return array{0: string, 1: string, 2: float|null}
* @public
* @since 4.0.012 (2008-07-24)
*/
@@ -10372,7 +10428,8 @@ class TCPDF {
/**
* Set footer font.
- * @param $font (array) Array describing the basic font parameters: (family, style, size).
+ * @param array $font Array describing the basic font parameters: (family, style, size).
+ * @phpstan-param array{0: string, 1: string, 2: float|null} $font
* @public
* @since 1.1
*/
@@ -10382,7 +10439,8 @@ class TCPDF {
/**
* Get Footer font.
- * @return array() Array describing the basic font parameters: (family, style, size).
+ * @return array Array describing the basic font parameters: (family, style, size).
+ * @phpstan-return array{0: string, 1: string, 2: float|null} $font
* @public
* @since 4.0.012 (2008-07-24)
*/
@@ -10392,7 +10450,7 @@ class TCPDF {
/**
* Set language array.
- * @param $language (array)
+ * @param array $language
* @public
* @since 1.1
*/
@@ -10418,17 +10476,17 @@ class TCPDF {
/**
* Output anchor link.
- * @param $url (string) link URL or internal link (i.e.: <a href="#23,4.5">link to page 23 at 4.5 Y position</a>)
- * @param $name (string) link name
- * @param $fill (boolean) Indicates if the cell background must be painted (true) or transparent (false).
- * @param $firstline (boolean) if true prints only the first line and return the remaining string.
- * @param $color (array) array of RGB text color
- * @param $style (string) font style (U, D, B, I)
- * @param $firstblock (boolean) if true the string is the starting of a line.
- * @return the number of cells used or the remaining text if $firstline = true;
+ * @param string $url link URL or internal link (i.e.: <a href="#23,4.5">link to page 23 at 4.5 Y position</a>)
+ * @param string $name link name
+ * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false).
+ * @param boolean $firstline if true prints only the first line and return the remaining string.
+ * @param array|null $color array of RGB text color
+ * @param string $style font style (U, D, B, I)
+ * @param boolean $firstblock if true the string is the starting of a line.
+ * @return int the number of cells used or the remaining text if $firstline = true;
* @public
*/
- public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color='', $style=-1, $firstblock=false) {
+ public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color=null, $style=-1, $firstblock=false) {
if (isset($url[1]) AND ($url[0] == '#') AND is_numeric($url[1])) {
// convert url to internal link
$lnkdata = explode(',', $url);
@@ -10440,32 +10498,32 @@ class TCPDF {
$lnky = 0;
}
$url = $this->AddLink();
- $this->SetLink($url, $lnky, $page);
+ $this->setLink($url, $lnky, $page);
}
}
// store current settings
$prevcolor = $this->fgcolor;
$prevstyle = $this->FontStyle;
if (empty($color)) {
- $this->SetTextColorArray($this->htmlLinkColorArray);
+ $this->setTextColorArray($this->htmlLinkColorArray);
} else {
- $this->SetTextColorArray($color);
+ $this->setTextColorArray($color);
}
if ($style == -1) {
- $this->SetFont('', $this->FontStyle.$this->htmlLinkFontStyle);
+ $this->setFont('', $this->FontStyle.$this->htmlLinkFontStyle);
} else {
- $this->SetFont('', $this->FontStyle.$style);
+ $this->setFont('', $this->FontStyle.$style);
}
$ret = $this->Write($this->lasth, $name, $url, $fill, '', false, 0, $firstline, $firstblock, 0);
// restore settings
- $this->SetFont('', $prevstyle);
- $this->SetTextColorArray($prevcolor);
+ $this->setFont('', $prevstyle);
+ $this->setTextColorArray($prevcolor);
return $ret;
}
/**
* Converts pixels to User's Units.
- * @param $px (int) pixels
+ * @param int $px pixels
* @return float value in user's unit
* @public
* @see setImageScale(), getImageScale()
@@ -10477,7 +10535,7 @@ class TCPDF {
/**
* Reverse function for htmlentities.
* Convert entities in UTF-8.
- * @param $text_to_convert (string) Text to convert.
+ * @param string $text_to_convert Text to convert.
* @return string converted text string
* @public
*/
@@ -10490,7 +10548,7 @@ class TCPDF {
/**
* Compute encryption key depending on object number where the encrypted data is stored.
* This is used for all strings and streams without crypt filter specifier.
- * @param $n (int) object number
+ * @param int $n object number
* @return int object key
* @protected
* @author Nicola Asuni
@@ -10509,9 +10567,9 @@ class TCPDF {
/**
* Encrypt the input string.
- * @param $n (int) object number
- * @param $s (string) data string to encrypt
- * @return encrypted string
+ * @param int $n object number
+ * @param string $s data string to encrypt
+ * @return string encrypted string
* @protected
* @author Nicola Asuni
* @since 5.0.005 (2010-05-11)
@@ -10754,7 +10812,7 @@ class TCPDF {
/**
* Convert password for AES-256 encryption mode
- * @param $password (string) password
+ * @param string $password password
* @return string password
* @protected
* @since 5.9.006 (2010-10-19)
@@ -10884,16 +10942,16 @@ class TCPDF {
* Remark: the protection against modification is for people who have the full Acrobat product.
* If you don't set any password, the document will open as usual. If you set a user password, the PDF viewer will ask for it before displaying the document. The master password, if different from the user one, can be used to get full access.
* Note: protecting a document requires to encrypt it, which increases the processing time a lot. This can cause a PHP time-out in some cases, especially if the document contains images or fonts.
- * @param $permissions (Array) the set of permissions (specify the ones you want to block):
print : Print the document;
modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';
copy : Copy or otherwise extract text and graphics from the document;
annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);
fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;
extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);
assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;
print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.
owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.
- * @param $user_pass (String) user password. Empty by default.
- * @param $owner_pass (String) owner password. If not specified, a random value is used.
- * @param $mode (int) encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit.
- * @param $pubkeys (String) array of recipients containing public-key certificates ('c') and permissions ('p'). For example: array(array('c' => 'file://../examples/data/cert/tcpdf.crt', 'p' => array('print')))
+ * @param array $permissions the set of permissions (specify the ones you want to block):
print : Print the document;
modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';
copy : Copy or otherwise extract text and graphics from the document;
annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);
fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;
extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);
assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;
print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.
owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.
+ * @param string $user_pass user password. Empty by default.
+ * @param string|null $owner_pass owner password. If not specified, a random value is used.
+ * @param int $mode encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit.
+ * @param array|null $pubkeys array of recipients containing public-key certificates ('c') and permissions ('p'). For example: array(array('c' => 'file://../examples/data/cert/tcpdf.crt', 'p' => array('print')))
* @public
* @since 2.0.000 (2008-01-02)
* @author Nicola Asuni
*/
- public function SetProtection($permissions=array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'), $user_pass='', $owner_pass=null, $mode=0, $pubkeys=null) {
+ public function setProtection($permissions=array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'), $user_pass='', $owner_pass=null, $mode=0, $pubkeys=null) {
if ($this->pdfa_mode) {
// encryption is not allowed in PDF/A mode
return;
@@ -11040,9 +11098,9 @@ class TCPDF {
}
/**
* Horizontal Scaling.
- * @param $s_x (float) scaling factor for width as percent. 0 is not allowed.
- * @param $x (int) abscissa of the scaling center. Default is current x position
- * @param $y (int) ordinate of the scaling center. Default is current y position
+ * @param float $s_x scaling factor for width as percent. 0 is not allowed.
+ * @param int $x abscissa of the scaling center. Default is current x position
+ * @param int $y ordinate of the scaling center. Default is current y position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
@@ -11053,9 +11111,9 @@ class TCPDF {
/**
* Vertical Scaling.
- * @param $s_y (float) scaling factor for height as percent. 0 is not allowed.
- * @param $x (int) abscissa of the scaling center. Default is current x position
- * @param $y (int) ordinate of the scaling center. Default is current y position
+ * @param float $s_y scaling factor for height as percent. 0 is not allowed.
+ * @param int $x abscissa of the scaling center. Default is current x position
+ * @param int $y ordinate of the scaling center. Default is current y position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
@@ -11066,9 +11124,9 @@ class TCPDF {
/**
* Vertical and horizontal proportional Scaling.
- * @param $s (float) scaling factor for width and height as percent. 0 is not allowed.
- * @param $x (int) abscissa of the scaling center. Default is current x position
- * @param $y (int) ordinate of the scaling center. Default is current y position
+ * @param float $s scaling factor for width and height as percent. 0 is not allowed.
+ * @param int $x abscissa of the scaling center. Default is current x position
+ * @param int $y ordinate of the scaling center. Default is current y position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
@@ -11079,19 +11137,19 @@ class TCPDF {
/**
* Vertical and horizontal non-proportional Scaling.
- * @param $s_x (float) scaling factor for width as percent. 0 is not allowed.
- * @param $s_y (float) scaling factor for height as percent. 0 is not allowed.
- * @param $x (int) abscissa of the scaling center. Default is current x position
- * @param $y (int) ordinate of the scaling center. Default is current y position
+ * @param float $s_x scaling factor for width as percent. 0 is not allowed.
+ * @param float $s_y scaling factor for height as percent. 0 is not allowed.
+ * @param float|null $x abscissa of the scaling center. Default is current x position
+ * @param float|null $y ordinate of the scaling center. Default is current y position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
*/
- public function Scale($s_x, $s_y, $x='', $y='') {
- if ($x === '') {
+ public function Scale($s_x, $s_y, $x=null, $y=null) {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
if (($s_x == 0) OR ($s_y == 0)) {
@@ -11115,55 +11173,55 @@ class TCPDF {
/**
* Horizontal Mirroring.
- * @param $x (int) abscissa of the point. Default is current x position
+ * @param float|null $x abscissa of the point. Default is current x position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
*/
- public function MirrorH($x='') {
+ public function MirrorH($x=null) {
$this->Scale(-100, 100, $x);
}
/**
* Verical Mirroring.
- * @param $y (int) ordinate of the point. Default is current y position
+ * @param float|null $y ordinate of the point. Default is current y position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
*/
- public function MirrorV($y='') {
- $this->Scale(100, -100, '', $y);
+ public function MirrorV($y=null) {
+ $this->Scale(100, -100, null, $y);
}
/**
* Point reflection mirroring.
- * @param $x (int) abscissa of the point. Default is current x position
- * @param $y (int) ordinate of the point. Default is current y position
+ * @param float|null $x abscissa of the point. Default is current x position
+ * @param float|null $y ordinate of the point. Default is current y position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
*/
- public function MirrorP($x='',$y='') {
+ public function MirrorP($x=null,$y=null) {
$this->Scale(-100, -100, $x, $y);
}
/**
* Reflection against a straight line through point (x, y) with the gradient angle (angle).
- * @param $angle (float) gradient angle of the straight line. Default is 0 (horizontal line).
- * @param $x (int) abscissa of the point. Default is current x position
- * @param $y (int) ordinate of the point. Default is current y position
+ * @param float $angle gradient angle of the straight line. Default is 0 (horizontal line).
+ * @param float|null $x abscissa of the point. Default is current x position
+ * @param float|null $y ordinate of the point. Default is current y position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
*/
- public function MirrorL($angle=0, $x='',$y='') {
+ public function MirrorL($angle=0, $x=null,$y=null) {
$this->Scale(-100, 100, $x, $y);
$this->Rotate(-2*($angle-90), $x, $y);
}
/**
* Translate graphic object horizontally.
- * @param $t_x (int) movement to the right (or left for RTL)
+ * @param int $t_x movement to the right (or left for RTL)
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
@@ -11174,7 +11232,7 @@ class TCPDF {
/**
* Translate graphic object vertically.
- * @param $t_y (int) movement to the bottom
+ * @param int $t_y movement to the bottom
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
@@ -11185,8 +11243,8 @@ class TCPDF {
/**
* Translate graphic object horizontally and vertically.
- * @param $t_x (int) movement to the right
- * @param $t_y (int) movement to the bottom
+ * @param int $t_x movement to the right
+ * @param int $t_y movement to the bottom
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
@@ -11206,18 +11264,18 @@ class TCPDF {
/**
* Rotate object.
- * @param $angle (float) angle in degrees for counter-clockwise rotation
- * @param $x (int) abscissa of the rotation center. Default is current x position
- * @param $y (int) ordinate of the rotation center. Default is current y position
+ * @param float $angle angle in degrees for counter-clockwise rotation
+ * @param float|null $x abscissa of the rotation center. Default is current x position
+ * @param float|null $y ordinate of the rotation center. Default is current y position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
*/
- public function Rotate($angle, $x='', $y='') {
- if ($x === '') {
+ public function Rotate($angle, $x=null, $y=null) {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
$y = ($this->h - $y) * $this->k;
@@ -11236,45 +11294,45 @@ class TCPDF {
/**
* Skew horizontally.
- * @param $angle_x (float) angle in degrees between -90 (skew to the left) and 90 (skew to the right)
- * @param $x (int) abscissa of the skewing center. default is current x position
- * @param $y (int) ordinate of the skewing center. default is current y position
+ * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right)
+ * @param float|null $x abscissa of the skewing center. default is current x position
+ * @param float|null $y ordinate of the skewing center. default is current y position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
*/
- public function SkewX($angle_x, $x='', $y='') {
+ public function SkewX($angle_x, $x=null, $y=null) {
$this->Skew($angle_x, 0, $x, $y);
}
/**
* Skew vertically.
- * @param $angle_y (float) angle in degrees between -90 (skew to the bottom) and 90 (skew to the top)
- * @param $x (int) abscissa of the skewing center. default is current x position
- * @param $y (int) ordinate of the skewing center. default is current y position
+ * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top)
+ * @param float|null $x abscissa of the skewing center. default is current x position
+ * @param float|null $y ordinate of the skewing center. default is current y position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
*/
- public function SkewY($angle_y, $x='', $y='') {
+ public function SkewY($angle_y, $x=null, $y=null) {
$this->Skew(0, $angle_y, $x, $y);
}
/**
* Skew.
- * @param $angle_x (float) angle in degrees between -90 (skew to the left) and 90 (skew to the right)
- * @param $angle_y (float) angle in degrees between -90 (skew to the bottom) and 90 (skew to the top)
- * @param $x (int) abscissa of the skewing center. default is current x position
- * @param $y (int) ordinate of the skewing center. default is current y position
+ * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right)
+ * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top)
+ * @param float|null $x abscissa of the skewing center. default is current x position
+ * @param float|null $y ordinate of the skewing center. default is current y position
* @public
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
*/
- public function Skew($angle_x, $angle_y, $x='', $y='') {
- if ($x === '') {
+ public function Skew($angle_x, $angle_y, $x=null, $y=null) {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
if (($angle_x <= -90) OR ($angle_x >= 90) OR ($angle_y <= -90) OR ($angle_y >= 90)) {
@@ -11296,7 +11354,7 @@ class TCPDF {
/**
* Apply graphic transformations.
- * @param $tm (array) transformation matrix
+ * @param array $tm transformation matrix
* @protected
* @since 2.1.000 (2008-01-07)
* @see StartTransform(), StopTransform()
@@ -11328,12 +11386,12 @@ class TCPDF {
/**
* Defines the line width. By default, the value equals 0.2 mm. The method can be called before the first page is created and the value is retained from page to page.
- * @param $width (float) The width.
+ * @param float $width The width.
* @public
* @since 1.0
* @see Line(), Rect(), Cell(), MultiCell()
*/
- public function SetLineWidth($width) {
+ public function setLineWidth($width) {
//Set line width
$this->LineWidth = $width;
$this->linestyleWidth = sprintf('%F w', ($width * $this->k));
@@ -11355,7 +11413,7 @@ class TCPDF {
/**
* Set line style.
- * @param $style (array) Line style. Array with keys among the following:
+ * @param array $style Line style. Array with keys among the following:
*
*
width (float): Width of the line in user units.
*
cap (string): Type of cap to put on the line. Possible values are:
@@ -11371,15 +11429,15 @@ class TCPDF {
* the point at which the pattern starts.
*
color (array): Draw color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName).
*
- * @param $ret (boolean) if true do not send the command.
+ * @param boolean $ret if true do not send the command.
* @return string the PDF command
* @public
* @since 2.1.000 (2008-01-08)
*/
- public function SetLineStyle($style, $ret=false) {
+ public function setLineStyle($style, $ret=false) {
$s = ''; // string to be returned
if (!is_array($style)) {
- return;
+ return $s;
}
if (isset($style['width'])) {
$this->LineWidth = $style['width'];
@@ -11423,7 +11481,7 @@ class TCPDF {
$s .= $this->linestyleDash.' ';
}
if (isset($style['color'])) {
- $s .= $this->SetDrawColorArray($style['color'], true).' ';
+ $s .= $this->setDrawColorArray($style['color'], true).' ';
}
if (!$ret AND ($this->state == 2)) {
$this->_out($s);
@@ -11433,8 +11491,8 @@ class TCPDF {
/**
* Begin a new subpath by moving the current point to coordinates (x, y), omitting any connecting line segment.
- * @param $x (float) Abscissa of point.
- * @param $y (float) Ordinate of point.
+ * @param float $x Abscissa of point.
+ * @param float $y Ordinate of point.
* @protected
* @since 2.1.000 (2008-01-08)
*/
@@ -11447,8 +11505,8 @@ class TCPDF {
/**
* Append a straight line segment from the current point to the point (x, y).
* The new current point shall be (x, y).
- * @param $x (float) Abscissa of end point.
- * @param $y (float) Ordinate of end point.
+ * @param float $x Abscissa of end point.
+ * @param float $y Ordinate of end point.
* @protected
* @since 2.1.000 (2008-01-08)
*/
@@ -11460,11 +11518,11 @@ class TCPDF {
/**
* Append a rectangle to the current path as a complete subpath, with lower-left corner (x, y) and dimensions widthand height in user space.
- * @param $x (float) Abscissa of upper-left corner.
- * @param $y (float) Ordinate of upper-left corner.
- * @param $w (float) Width.
- * @param $h (float) Height.
- * @param $op (string) options
+ * @param float $x Abscissa of upper-left corner.
+ * @param float $y Ordinate of upper-left corner.
+ * @param float $w Width.
+ * @param float $h Height.
+ * @param string $op options
* @protected
* @since 2.1.000 (2008-01-08)
*/
@@ -11477,12 +11535,12 @@ class TCPDF {
/**
* Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the Bezier control points.
* The new current point shall be (x3, y3).
- * @param $x1 (float) Abscissa of control point 1.
- * @param $y1 (float) Ordinate of control point 1.
- * @param $x2 (float) Abscissa of control point 2.
- * @param $y2 (float) Ordinate of control point 2.
- * @param $x3 (float) Abscissa of end point.
- * @param $y3 (float) Ordinate of end point.
+ * @param float $x1 Abscissa of control point 1.
+ * @param float $y1 Ordinate of control point 1.
+ * @param float $x2 Abscissa of control point 2.
+ * @param float $y2 Ordinate of control point 2.
+ * @param float $x3 Abscissa of end point.
+ * @param float $y3 Ordinate of end point.
* @protected
* @since 2.1.000 (2008-01-08)
*/
@@ -11495,10 +11553,10 @@ class TCPDF {
/**
* Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using the current point and (x2, y2) as the Bezier control points.
* The new current point shall be (x3, y3).
- * @param $x2 (float) Abscissa of control point 2.
- * @param $y2 (float) Ordinate of control point 2.
- * @param $x3 (float) Abscissa of end point.
- * @param $y3 (float) Ordinate of end point.
+ * @param float $x2 Abscissa of control point 2.
+ * @param float $y2 Ordinate of control point 2.
+ * @param float $x3 Abscissa of end point.
+ * @param float $y3 Ordinate of end point.
* @protected
* @since 4.9.019 (2010-04-26)
*/
@@ -11511,10 +11569,10 @@ class TCPDF {
/**
* Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the Bezier control points.
* The new current point shall be (x3, y3).
- * @param $x1 (float) Abscissa of control point 1.
- * @param $y1 (float) Ordinate of control point 1.
- * @param $x3 (float) Abscissa of end point.
- * @param $y3 (float) Ordinate of end point.
+ * @param float $x1 Abscissa of control point 1.
+ * @param float $y1 Ordinate of control point 1.
+ * @param float $x3 Abscissa of end point.
+ * @param float $y3 Ordinate of end point.
* @protected
* @since 2.1.000 (2008-01-08)
*/
@@ -11526,11 +11584,11 @@ class TCPDF {
/**
* Draws a line between two points.
- * @param $x1 (float) Abscissa of first point.
- * @param $y1 (float) Ordinate of first point.
- * @param $x2 (float) Abscissa of second point.
- * @param $y2 (float) Ordinate of second point.
- * @param $style (array) Line style. Array like for SetLineStyle(). Default value: default line style (empty array).
+ * @param float $x1 Abscissa of first point.
+ * @param float $y1 Ordinate of first point.
+ * @param float $x2 Abscissa of second point.
+ * @param float $y2 Ordinate of second point.
+ * @param array $style Line style. Array like for SetLineStyle(). Default value: default line style (empty array).
* @public
* @since 1.0
* @see SetLineWidth(), SetDrawColor(), SetLineStyle()
@@ -11540,7 +11598,7 @@ class TCPDF {
return;
}
if (is_array($style)) {
- $this->SetLineStyle($style);
+ $this->setLineStyle($style);
}
$this->_outPoint($x1, $y1);
$this->_outLine($x2, $y2);
@@ -11549,18 +11607,18 @@ class TCPDF {
/**
* Draws a rectangle.
- * @param $x (float) Abscissa of upper-left corner.
- * @param $y (float) Ordinate of upper-left corner.
- * @param $w (float) Width.
- * @param $h (float) Height.
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $border_style (array) Border style of rectangle. Array with keys among the following:
+ * @param float $x Abscissa of upper-left corner.
+ * @param float $y Ordinate of upper-left corner.
+ * @param float $w Width.
+ * @param float $h Height.
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param array $border_style Border style of rectangle. Array with keys among the following:
*
*
all: Line style of all borders. Array like for SetLineStyle().
*
L, T, R, B or combinations: Line style of left, top, right or bottom border. Array like for SetLineStyle().
*
* If a key is not present or is null, the correspondent border is not drawn. Default value: default line style (empty array).
- * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
+ * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
* @public
* @since 1.0
* @see SetLineStyle()
@@ -11574,12 +11632,12 @@ class TCPDF {
}
if (!(strpos($style, 'F') === false) AND !empty($fill_color)) {
// set background color
- $this->SetFillColorArray($fill_color);
+ $this->setFillColorArray($fill_color);
}
if (!empty($border_style)) {
if (isset($border_style['all']) AND !empty($border_style['all'])) {
//set global style for border
- $this->SetLineStyle($border_style['all']);
+ $this->setLineStyle($border_style['all']);
$border_style = array();
} else {
// remove stroke operator from style
@@ -11621,17 +11679,17 @@ class TCPDF {
* Draws a Bezier curve.
* The Bezier curve is a tangent to the line between the control points at
* either end of the curve.
- * @param $x0 (float) Abscissa of start point.
- * @param $y0 (float) Ordinate of start point.
- * @param $x1 (float) Abscissa of control point 1.
- * @param $y1 (float) Ordinate of control point 1.
- * @param $x2 (float) Abscissa of control point 2.
- * @param $y2 (float) Ordinate of control point 2.
- * @param $x3 (float) Abscissa of end point.
- * @param $y3 (float) Ordinate of end point.
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $line_style (array) Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array).
- * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
+ * @param float $x0 Abscissa of start point.
+ * @param float $y0 Ordinate of start point.
+ * @param float $x1 Abscissa of control point 1.
+ * @param float $y1 Ordinate of control point 1.
+ * @param float $x2 Abscissa of control point 2.
+ * @param float $y2 Ordinate of control point 2.
+ * @param float $x3 Abscissa of end point.
+ * @param float $y3 Ordinate of end point.
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param array $line_style Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array).
+ * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
* @public
* @see SetLineStyle()
* @since 2.1.000 (2008-01-08)
@@ -11641,11 +11699,11 @@ class TCPDF {
return;
}
if (!(false === strpos($style, 'F')) AND isset($fill_color)) {
- $this->SetFillColorArray($fill_color);
+ $this->setFillColorArray($fill_color);
}
$op = TCPDF_STATIC::getPathPaintOperator($style);
if ($line_style) {
- $this->SetLineStyle($line_style);
+ $this->setLineStyle($line_style);
}
$this->_outPoint($x0, $y0);
$this->_outCurve($x1, $y1, $x2, $y2, $x3, $y3);
@@ -11656,12 +11714,12 @@ class TCPDF {
* Draws a poly-Bezier curve.
* Each Bezier curve segment is a tangent to the line between the control points at
* either end of the curve.
- * @param $x0 (float) Abscissa of start point.
- * @param $y0 (float) Ordinate of start point.
- * @param $segments (float) An array of bezier descriptions. Format: array(x1, y1, x2, y2, x3, y3).
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $line_style (array) Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array).
- * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
+ * @param float $x0 Abscissa of start point.
+ * @param float $y0 Ordinate of start point.
+ * @param float[] $segments An array of bezier descriptions. Format: array(x1, y1, x2, y2, x3, y3).
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param array $line_style Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array).
+ * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
* @public
* @see SetLineStyle()
* @since 3.0008 (2008-05-12)
@@ -11671,14 +11729,14 @@ class TCPDF {
return;
}
if (!(false === strpos($style, 'F')) AND isset($fill_color)) {
- $this->SetFillColorArray($fill_color);
+ $this->setFillColorArray($fill_color);
}
$op = TCPDF_STATIC::getPathPaintOperator($style);
if ($op == 'f') {
$line_style = array();
}
if ($line_style) {
- $this->SetLineStyle($line_style);
+ $this->setLineStyle($line_style);
}
$this->_outPoint($x0, $y0);
foreach ($segments as $segment) {
@@ -11691,22 +11749,22 @@ class TCPDF {
/**
* Draws an ellipse.
* An ellipse is formed from n Bezier curves.
- * @param $x0 (float) Abscissa of center point.
- * @param $y0 (float) Ordinate of center point.
- * @param $rx (float) Horizontal radius.
- * @param $ry (float) Vertical radius (if ry = 0 then is a circle, see Circle()). Default value: 0.
- * @param $angle: (float) Angle oriented (anti-clockwise). Default value: 0.
- * @param $astart: (float) Angle start of draw line. Default value: 0.
- * @param $afinish: (float) Angle finish of draw line. Default value: 360.
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $line_style (array) Line style of ellipse. Array like for SetLineStyle(). Default value: default line style (empty array).
- * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
- * @param $nc (integer) Number of curves used to draw a 90 degrees portion of ellipse.
+ * @param float $x0 Abscissa of center point.
+ * @param float $y0 Ordinate of center point.
+ * @param float $rx Horizontal radius.
+ * @param float $ry Vertical radius (if ry = 0 then is a circle, see Circle()). Default value: 0.
+ * @param float $angle Angle oriented (anti-clockwise). Default value: 0.
+ * @param float $astart Angle start of draw line. Default value: 0.
+ * @param float $afinish Angle finish of draw line. Default value: 360.
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param array $line_style Line style of ellipse. Array like for SetLineStyle(). Default value: default line style (empty array).
+ * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
+ * @param integer $nc Number of curves used to draw a 90 degrees portion of ellipse.
* @author Nicola Asuni
* @public
* @since 2.1.000 (2008-01-08)
*/
- public function Ellipse($x0, $y0, $rx, $ry='', $angle=0, $astart=0, $afinish=360, $style='', $line_style=array(), $fill_color=array(), $nc=2) {
+ public function Ellipse($x0, $y0, $rx, $ry=0, $angle=0, $astart=0, $afinish=360, $style='', $line_style=array(), $fill_color=array(), $nc=2) {
if ($this->state != 2) {
return;
}
@@ -11714,14 +11772,14 @@ class TCPDF {
$ry = $rx;
}
if (!(false === strpos($style, 'F')) AND isset($fill_color)) {
- $this->SetFillColorArray($fill_color);
+ $this->setFillColorArray($fill_color);
}
$op = TCPDF_STATIC::getPathPaintOperator($style);
if ($op == 'f') {
$line_style = array();
}
if ($line_style) {
- $this->SetLineStyle($line_style);
+ $this->setLineStyle($line_style);
}
$this->_outellipticalarc($x0, $y0, $rx, $ry, $angle, $astart, $afinish, false, $nc, true, true, false);
$this->_out($op);
@@ -11730,18 +11788,18 @@ class TCPDF {
/**
* Append an elliptical arc to the current path.
* An ellipse is formed from n Bezier curves.
- * @param $xc (float) Abscissa of center point.
- * @param $yc (float) Ordinate of center point.
- * @param $rx (float) Horizontal radius.
- * @param $ry (float) Vertical radius (if ry = 0 then is a circle, see Circle()). Default value: 0.
- * @param $xang: (float) Angle between the X-axis and the major axis of the ellipse. Default value: 0.
- * @param $angs: (float) Angle start of draw line. Default value: 0.
- * @param $angf: (float) Angle finish of draw line. Default value: 360.
- * @param $pie (boolean) if true do not mark the border point (used to draw pie sectors).
- * @param $nc (integer) Number of curves used to draw a 90 degrees portion of ellipse.
- * @param $startpoint (boolean) if true output a starting point.
- * @param $ccw (boolean) if true draws in counter-clockwise.
- * @param $svg (boolean) if true the angles are in svg mode (already calculated).
+ * @param float $xc Abscissa of center point.
+ * @param float $yc Ordinate of center point.
+ * @param float $rx Horizontal radius.
+ * @param float $ry Vertical radius (if ry = 0 then is a circle, see Circle()). Default value: 0.
+ * @param float $xang Angle between the X-axis and the major axis of the ellipse. Default value: 0.
+ * @param float $angs Angle start of draw line. Default value: 0.
+ * @param float $angf Angle finish of draw line. Default value: 360.
+ * @param boolean $pie if true do not mark the border point (used to draw pie sectors).
+ * @param integer $nc Number of curves used to draw a 90 degrees portion of ellipse.
+ * @param boolean $startpoint if true output a starting point.
+ * @param boolean $ccw if true draws in counter-clockwise.
+ * @param boolean $svg if true the angles are in svg mode (already calculated).
* @return array bounding box coordinates (x min, y min, x max, y max)
* @author Nicola Asuni
* @protected
@@ -11866,15 +11924,15 @@ class TCPDF {
/**
* Draws a circle.
* A circle is formed from n Bezier curves.
- * @param $x0 (float) Abscissa of center point.
- * @param $y0 (float) Ordinate of center point.
- * @param $r (float) Radius.
- * @param $angstr: (float) Angle start of draw line. Default value: 0.
- * @param $angend: (float) Angle finish of draw line. Default value: 360.
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $line_style (array) Line style of circle. Array like for SetLineStyle(). Default value: default line style (empty array).
- * @param $fill_color (array) Fill color. Format: array(red, green, blue). Default value: default color (empty array).
- * @param $nc (integer) Number of curves used to draw a 90 degrees portion of circle.
+ * @param float $x0 Abscissa of center point.
+ * @param float $y0 Ordinate of center point.
+ * @param float $r Radius.
+ * @param float $angstr Angle start of draw line. Default value: 0.
+ * @param float $angend Angle finish of draw line. Default value: 360.
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param array $line_style Line style of circle. Array like for SetLineStyle(). Default value: default line style (empty array).
+ * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array).
+ * @param integer $nc Number of curves used to draw a 90 degrees portion of circle.
* @public
* @since 2.1.000 (2008-01-08)
*/
@@ -11884,15 +11942,15 @@ class TCPDF {
/**
* Draws a polygonal line
- * @param $p (array) Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1))
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $line_style (array) Line style of polygon. Array with keys among the following:
+ * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1))
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param array $line_style Line style of polygon. Array with keys among the following:
*
*
all: Line style of all lines. Array like for SetLineStyle().
*
0 to ($np - 1): Line style of each line. Array like for SetLineStyle().
*
* If a key is not present or is null, not draws the line. Default value is default line style (empty array).
- * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
+ * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
* @since 4.8.003 (2009-09-15)
* @public
*/
@@ -11902,16 +11960,16 @@ class TCPDF {
/**
* Draws a polygon.
- * @param $p (array) Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1))
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $line_style (array) Line style of polygon. Array with keys among the following:
+ * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1))
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param array $line_style Line style of polygon. Array with keys among the following:
*
*
all: Line style of all lines. Array like for SetLineStyle().
*
0 to ($np - 1): Line style of each line. Array like for SetLineStyle().
*
* If a key is not present or is null, not draws the line. Default value is default line style (empty array).
- * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
- * @param $closed (boolean) if true the polygon is closes, otherwise will remain open
+ * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
+ * @param boolean $closed if true the polygon is closes, otherwise will remain open
* @public
* @since 2.1.000 (2008-01-08)
*/
@@ -11933,7 +11991,7 @@ class TCPDF {
$nc += 4;
}
if (!(false === strpos($style, 'F')) AND isset($fill_color)) {
- $this->SetFillColorArray($fill_color);
+ $this->setFillColorArray($fill_color);
}
$op = TCPDF_STATIC::getPathPaintOperator($style);
if ($op == 'f') {
@@ -11942,7 +12000,7 @@ class TCPDF {
$draw = true;
if ($line_style) {
if (isset($line_style['all'])) {
- $this->SetLineStyle($line_style['all']);
+ $this->setLineStyle($line_style['all']);
} else {
$draw = false;
if ($op == 'B') {
@@ -11962,7 +12020,7 @@ class TCPDF {
if ($line_style[$line_num] != 0) {
if (is_array($line_style[$line_num])) {
$this->_out('S');
- $this->SetLineStyle($line_style[$line_num]);
+ $this->setLineStyle($line_style[$line_num]);
$this->_outPoint($p[$i - 2], $p[$i - 1]);
$this->_outLine($p[$i], $p[$i + 1]);
$this->_out('S');
@@ -11989,21 +12047,21 @@ class TCPDF {
/**
* Draws a regular polygon.
- * @param $x0 (float) Abscissa of center point.
- * @param $y0 (float) Ordinate of center point.
- * @param $r: (float) Radius of inscribed circle.
- * @param $ns (integer) Number of sides.
- * @param $angle (float) Angle oriented (anti-clockwise). Default value: 0.
- * @param $draw_circle (boolean) Draw inscribed circle or not. Default value: false.
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $line_style (array) Line style of polygon sides. Array with keys among the following:
+ * @param float $x0 Abscissa of center point.
+ * @param float $y0 Ordinate of center point.
+ * @param float $r Radius of inscribed circle.
+ * @param integer $ns Number of sides.
+ * @param float $angle Angle oriented (anti-clockwise). Default value: 0.
+ * @param boolean $draw_circle Draw inscribed circle or not. Default value: false.
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param array $line_style Line style of polygon sides. Array with keys among the following:
*
*
all: Line style of all sides. Array like for SetLineStyle().
*
0 to ($ns - 1): Line style of each side. Array like for SetLineStyle().
*
* If a key is not present or is null, not draws the side. Default value is default line style (empty array).
- * @param $fill_color (array) Fill color. Format: array(red, green, blue). Default value: default color (empty array).
- * @param $circle_style (string) Style of rendering of inscribed circle (if draws). Possible values are:
+ * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array).
+ * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are:
*
*
D or empty string: Draw (default).
*
F: Fill.
@@ -12011,8 +12069,8 @@ class TCPDF {
*
CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
*
CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
*
- * @param $circle_outLine_style (array) Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array).
- * @param $circle_fill_color (array) Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array).
+ * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array).
+ * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array).
* @public
* @since 2.1.000 (2008-01-08)
*/
@@ -12035,23 +12093,23 @@ class TCPDF {
/**
* Draws a star polygon
- * @param $x0 (float) Abscissa of center point.
- * @param $y0 (float) Ordinate of center point.
- * @param $r (float) Radius of inscribed circle.
- * @param $nv (integer) Number of vertices.
- * @param $ng (integer) Number of gap (if ($ng % $nv = 1) then is a regular polygon).
- * @param $angle: (float) Angle oriented (anti-clockwise). Default value: 0.
- * @param $draw_circle: (boolean) Draw inscribed circle or not. Default value is false.
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $line_style (array) Line style of polygon sides. Array with keys among the following:
+ * @param float $x0 Abscissa of center point.
+ * @param float $y0 Ordinate of center point.
+ * @param float $r Radius of inscribed circle.
+ * @param integer $nv Number of vertices.
+ * @param integer $ng Number of gap (if ($ng % $nv = 1) then is a regular polygon).
+ * @param float $angle Angle oriented (anti-clockwise). Default value: 0.
+ * @param boolean $draw_circle Draw inscribed circle or not. Default value is false.
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param array $line_style Line style of polygon sides. Array with keys among the following:
*
*
all: Line style of all sides. Array like for
* SetLineStyle().
*
0 to (n - 1): Line style of each side. Array like for SetLineStyle().
*
* If a key is not present or is null, not draws the side. Default value is default line style (empty array).
- * @param $fill_color (array) Fill color. Format: array(red, green, blue). Default value: default color (empty array).
- * @param $circle_style (string) Style of rendering of inscribed circle (if draws). Possible values are:
+ * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array).
+ * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are:
*
*
D or empty string: Draw (default).
*
F: Fill.
@@ -12059,8 +12117,8 @@ class TCPDF {
*
CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
*
CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
*
- * @param $circle_outLine_style (array) Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array).
- * @param $circle_fill_color (array) Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array).
+ * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array).
+ * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array).
* @public
* @since 2.1.000 (2008-01-08)
*/
@@ -12094,15 +12152,15 @@ class TCPDF {
/**
* Draws a rounded rectangle.
- * @param $x (float) Abscissa of upper-left corner.
- * @param $y (float) Ordinate of upper-left corner.
- * @param $w (float) Width.
- * @param $h (float) Height.
- * @param $r (float) the radius of the circle used to round off the corners of the rectangle.
- * @param $round_corner (string) Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111").
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $border_style (array) Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array).
- * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
+ * @param float $x Abscissa of upper-left corner.
+ * @param float $y Ordinate of upper-left corner.
+ * @param float $w Width.
+ * @param float $h Height.
+ * @param float $r the radius of the circle used to round off the corners of the rectangle.
+ * @param string $round_corner Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111").
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param array $border_style Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array).
+ * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
* @public
* @since 2.1.000 (2008-01-08)
*/
@@ -12112,16 +12170,16 @@ class TCPDF {
/**
* Draws a rounded rectangle.
- * @param $x (float) Abscissa of upper-left corner.
- * @param $y (float) Ordinate of upper-left corner.
- * @param $w (float) Width.
- * @param $h (float) Height.
- * @param $rx (float) the x-axis radius of the ellipse used to round off the corners of the rectangle.
- * @param $ry (float) the y-axis radius of the ellipse used to round off the corners of the rectangle.
- * @param $round_corner (string) Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111").
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $border_style (array) Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array).
- * @param $fill_color (array) Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
+ * @param float $x Abscissa of upper-left corner.
+ * @param float $y Ordinate of upper-left corner.
+ * @param float $w Width.
+ * @param float $h Height.
+ * @param float $rx the x-axis radius of the ellipse used to round off the corners of the rectangle.
+ * @param float $ry the y-axis radius of the ellipse used to round off the corners of the rectangle.
+ * @param string $round_corner Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111").
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param array $border_style Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array).
+ * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).
* @public
* @since 4.9.019 (2010-04-22)
*/
@@ -12136,14 +12194,14 @@ class TCPDF {
}
// Rounded
if (!(false === strpos($style, 'F')) AND isset($fill_color)) {
- $this->SetFillColorArray($fill_color);
+ $this->setFillColorArray($fill_color);
}
$op = TCPDF_STATIC::getPathPaintOperator($style);
if ($op == 'f') {
$border_style = array();
}
if ($border_style) {
- $this->SetLineStyle($border_style);
+ $this->setLineStyle($border_style);
}
$MyArc = 4 / 3 * (sqrt(2) - 1);
$this->_outPoint($x + $rx, $y);
@@ -12185,13 +12243,13 @@ class TCPDF {
/**
* Draws a grahic arrow.
- * @param $x0 (float) Abscissa of first point.
- * @param $y0 (float) Ordinate of first point.
- * @param $x1 (float) Abscissa of second point.
- * @param $y1 (float) Ordinate of second point.
- * @param $head_style (int) (0 = draw only arrowhead arms, 1 = draw closed arrowhead, but no fill, 2 = closed and filled arrowhead, 3 = filled arrowhead)
- * @param $arm_size (float) length of arrowhead arms
- * @param $arm_angle (int) angle between an arm and the shaft
+ * @param float $x0 Abscissa of first point.
+ * @param float $y0 Ordinate of first point.
+ * @param float $x1 Abscissa of second point.
+ * @param float $y1 Ordinate of second point.
+ * @param int $head_style (0 = draw only arrowhead arms, 1 = draw closed arrowhead, but no fill, 2 = closed and filled arrowhead, 3 = filled arrowhead)
+ * @param float $arm_size length of arrowhead arms
+ * @param int $arm_angle angle between an arm and the shaft
* @author Piotr Galecki, Nicola Asuni, Andy Meier
* @since 4.6.018 (2009-07-10)
*/
@@ -12251,11 +12309,11 @@ class TCPDF {
/**
* Add a Named Destination.
* NOTE: destination names are unique, so only last entry will be saved.
- * @param $name (string) Destination name.
- * @param $y (float) Y position in user units of the destiantion on the selected page (default = -1 = current position; 0 = page start;).
- * @param $page (int|string) Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.
- * @param $x (float) X position in user units of the destiantion on the selected page (default = -1 = current position;).
- * @return (string) Stripped named destination identifier or false in case of error.
+ * @param string $name Destination name.
+ * @param float $y Y position in user units of the destiantion on the selected page (default = -1 = current position; 0 = page start;).
+ * @param int|string $page Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.
+ * @param float $x X position in user units of the destiantion on the selected page (default = -1 = current position;).
+ * @return string|false Stripped named destination identifier or false in case of error.
* @public
* @author Christian Deligant, Nicola Asuni
* @since 5.9.097 (2011-06-23)
@@ -12298,7 +12356,7 @@ class TCPDF {
/**
* Return the Named Destination array.
- * @return (array) Named Destination array.
+ * @return array Named Destination array.
* @public
* @author Nicola Asuni
* @since 5.9.097 (2011-06-23)
@@ -12329,14 +12387,14 @@ class TCPDF {
/**
* Adds a bookmark - alias for Bookmark().
- * @param $txt (string) Bookmark description.
- * @param $level (int) Bookmark level (minimum value is 0).
- * @param $y (float) Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;).
- * @param $page (int|string) Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.
- * @param $style (string) Font style: B = Bold, I = Italic, BI = Bold + Italic.
- * @param $color (array) RGB color array (values from 0 to 255).
- * @param $x (float) X position in user units of the bookmark on the selected page (default = -1 = current position;).
- * @param $link (mixed) URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name).
+ * @param string $txt Bookmark description.
+ * @param int $level Bookmark level (minimum value is 0).
+ * @param float $y Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;).
+ * @param int|string $page Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.
+ * @param string $style Font style: B = Bold, I = Italic, BI = Bold + Italic.
+ * @param array $color RGB color array (values from 0 to 255).
+ * @param float $x X position in user units of the bookmark on the selected page (default = -1 = current position;).
+ * @param mixed $link URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name).
* @public
*/
public function setBookmark($txt, $level=0, $y=-1, $page='', $style='', $color=array(0,0,0), $x=-1, $link='') {
@@ -12345,14 +12403,14 @@ class TCPDF {
/**
* Adds a bookmark.
- * @param $txt (string) Bookmark description.
- * @param $level (int) Bookmark level (minimum value is 0).
- * @param $y (float) Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;).
- * @param $page (int|string) Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.
- * @param $style (string) Font style: B = Bold, I = Italic, BI = Bold + Italic.
- * @param $color (array) RGB color array (values from 0 to 255).
- * @param $x (float) X position in user units of the bookmark on the selected page (default = -1 = current position;).
- * @param $link (mixed) URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name).
+ * @param string $txt Bookmark description.
+ * @param int $level Bookmark level (minimum value is 0).
+ * @param float $y Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;).
+ * @param int|string $page Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.
+ * @param string $style Font style: B = Bold, I = Italic, BI = Bold + Italic.
+ * @param array $color RGB color array (values from 0 to 255).
+ * @param float $x X position in user units of the bookmark on the selected page (default = -1 = current position;).
+ * @param mixed $link URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name).
* @public
* @since 2.1.002 (2008-02-12)
*/
@@ -12543,7 +12601,7 @@ class TCPDF {
/**
* Adds a javascript
- * @param $script (string) Javascript code
+ * @param string $script Javascript code
* @public
* @author Johannes G\FCntert, Nicola Asuni
* @since 2.1.002 (2008-02-12)
@@ -12554,8 +12612,8 @@ class TCPDF {
/**
* Adds a javascript object and return object ID
- * @param $script (string) Javascript code
- * @param $onload (boolean) if true executes this object when opening the document
+ * @param string $script Javascript code
+ * @param boolean $onload if true executes this object when opening the document
* @return int internal object ID
* @public
* @author Nicola Asuni
@@ -12624,13 +12682,13 @@ class TCPDF {
/**
* Adds a javascript form field.
- * @param $type (string) field type
- * @param $name (string) field name
- * @param $x (int) horizontal position
- * @param $y (int) vertical position
- * @param $w (int) width
- * @param $h (int) height
- * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
+ * @param string $type field type
+ * @param string $name field name
+ * @param int $x horizontal position
+ * @param int $y vertical position
+ * @param int $w width
+ * @param int $h height
+ * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
* @protected
* @author Denis Van Nuffelen, Nicola Asuni
* @since 2.1.002 (2008-02-12)
@@ -12666,7 +12724,7 @@ class TCPDF {
/**
* Set default properties for form fields.
- * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
+ * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
* @public
* @author Nicola Asuni
* @since 4.8.000 (2009-09-06)
@@ -12688,23 +12746,23 @@ class TCPDF {
/**
* Creates a text field
- * @param $name (string) field name
- * @param $w (float) Width of the rectangle
- * @param $h (float) Height of the rectangle
- * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
- * @param $opt (array) annotation parameters. Possible values are described on official PDF32000_2008 reference.
- * @param $x (float) Abscissa of the upper-left corner of the rectangle
- * @param $y (float) Ordinate of the upper-left corner of the rectangle
- * @param $js (boolean) if true put the field using JavaScript (requires Acrobat Writer to be rendered).
+ * @param string $name field name
+ * @param float $w Width of the rectangle
+ * @param float $h Height of the rectangle
+ * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
+ * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference.
+ * @param float|null $x Abscissa of the upper-left corner of the rectangle
+ * @param float|null $y Ordinate of the upper-left corner of the rectangle
+ * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered).
* @public
* @author Nicola Asuni
* @since 4.8.000 (2009-09-07)
*/
- public function TextField($name, $w, $h, $prop=array(), $opt=array(), $x='', $y='', $js=false) {
- if ($x === '') {
+ public function TextField($name, $w, $h, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
@@ -12808,24 +12866,24 @@ class TCPDF {
/**
* Creates a RadioButton field.
- * @param $name (string) Field name.
- * @param $w (int) Width of the radio button.
- * @param $prop (array) Javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
- * @param $opt (array) Annotation parameters. Possible values are described on official PDF32000_2008 reference.
- * @param $onvalue (string) Value to be returned if selected.
- * @param $checked (boolean) Define the initial state.
- * @param $x (float) Abscissa of the upper-left corner of the rectangle
- * @param $y (float) Ordinate of the upper-left corner of the rectangle
- * @param $js (boolean) If true put the field using JavaScript (requires Acrobat Writer to be rendered).
+ * @param string $name Field name.
+ * @param int $w Width of the radio button.
+ * @param array $prop Javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
+ * @param array $opt Annotation parameters. Possible values are described on official PDF32000_2008 reference.
+ * @param string $onvalue Value to be returned if selected.
+ * @param boolean $checked Define the initial state.
+ * @param float|null $x Abscissa of the upper-left corner of the rectangle
+ * @param float|null $y Ordinate of the upper-left corner of the rectangle
+ * @param boolean $js If true put the field using JavaScript (requires Acrobat Writer to be rendered).
* @public
* @author Nicola Asuni
* @since 4.8.000 (2009-09-07)
*/
- public function RadioButton($name, $w, $prop=array(), $opt=array(), $onvalue='On', $checked=false, $x='', $y='', $js=false) {
- if ($x === '') {
+ public function RadioButton($name, $w, $prop=array(), $opt=array(), $onvalue='On', $checked=false, $x=null, $y=null, $js=false) {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
@@ -12911,24 +12969,24 @@ class TCPDF {
/**
* Creates a List-box field
- * @param $name (string) field name
- * @param $w (int) width
- * @param $h (int) height
- * @param $values (array) array containing the list of values.
- * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
- * @param $opt (array) annotation parameters. Possible values are described on official PDF32000_2008 reference.
- * @param $x (float) Abscissa of the upper-left corner of the rectangle
- * @param $y (float) Ordinate of the upper-left corner of the rectangle
- * @param $js (boolean) if true put the field using JavaScript (requires Acrobat Writer to be rendered).
+ * @param string $name field name
+ * @param int $w width
+ * @param int $h height
+ * @param array $values array containing the list of values.
+ * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
+ * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference.
+ * @param float|null $x Abscissa of the upper-left corner of the rectangle
+ * @param float|null $y Ordinate of the upper-left corner of the rectangle
+ * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered).
* @public
* @author Nicola Asuni
* @since 4.8.000 (2009-09-07)
*/
- public function ListBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x='', $y='', $js=false) {
- if ($x === '') {
+ public function ListBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
@@ -12997,24 +13055,24 @@ class TCPDF {
/**
* Creates a Combo-box field
- * @param $name (string) field name
- * @param $w (int) width
- * @param $h (int) height
- * @param $values (array) array containing the list of values.
- * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
- * @param $opt (array) annotation parameters. Possible values are described on official PDF32000_2008 reference.
- * @param $x (float) Abscissa of the upper-left corner of the rectangle
- * @param $y (float) Ordinate of the upper-left corner of the rectangle
- * @param $js (boolean) if true put the field using JavaScript (requires Acrobat Writer to be rendered).
+ * @param string $name field name
+ * @param int $w width
+ * @param int $h height
+ * @param array $values array containing the list of values.
+ * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
+ * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference.
+ * @param float|null $x Abscissa of the upper-left corner of the rectangle
+ * @param float|null $y Ordinate of the upper-left corner of the rectangle
+ * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered).
* @public
* @author Nicola Asuni
* @since 4.8.000 (2009-09-07)
*/
- public function ComboBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x='', $y='', $js=false) {
- if ($x === '') {
+ public function ComboBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
@@ -13084,24 +13142,24 @@ class TCPDF {
/**
* Creates a CheckBox field
- * @param $name (string) field name
- * @param $w (int) width
- * @param $checked (boolean) define the initial state.
- * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
- * @param $opt (array) annotation parameters. Possible values are described on official PDF32000_2008 reference.
- * @param $onvalue (string) value to be returned if selected.
- * @param $x (float) Abscissa of the upper-left corner of the rectangle
- * @param $y (float) Ordinate of the upper-left corner of the rectangle
- * @param $js (boolean) if true put the field using JavaScript (requires Acrobat Writer to be rendered).
+ * @param string $name field name
+ * @param int $w width
+ * @param boolean $checked define the initial state.
+ * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
+ * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference.
+ * @param string $onvalue value to be returned if selected.
+ * @param float|null $x Abscissa of the upper-left corner of the rectangle
+ * @param float|null $y Ordinate of the upper-left corner of the rectangle
+ * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered).
* @public
* @author Nicola Asuni
* @since 4.8.000 (2009-09-07)
*/
- public function CheckBox($name, $w, $checked=false, $prop=array(), $opt=array(), $onvalue='Yes', $x='', $y='', $js=false) {
- if ($x === '') {
+ public function CheckBox($name, $w, $checked=false, $prop=array(), $opt=array(), $onvalue='Yes', $x=null, $y=null, $js=false) {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
@@ -13163,25 +13221,25 @@ class TCPDF {
/**
* Creates a button field
- * @param $name (string) field name
- * @param $w (int) width
- * @param $h (int) height
- * @param $caption (string) caption.
- * @param $action (mixed) action triggered by pressing the button. Use a string to specify a javascript action. Use an array to specify a form action options as on section 12.7.5 of PDF32000_2008.
- * @param $prop (array) javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
- * @param $opt (array) annotation parameters. Possible values are described on official PDF32000_2008 reference.
- * @param $x (float) Abscissa of the upper-left corner of the rectangle
- * @param $y (float) Ordinate of the upper-left corner of the rectangle
- * @param $js (boolean) if true put the field using JavaScript (requires Acrobat Writer to be rendered).
+ * @param string $name field name
+ * @param int $w width
+ * @param int $h height
+ * @param string $caption caption.
+ * @param mixed $action action triggered by pressing the button. Use a string to specify a javascript action. Use an array to specify a form action options as on section 12.7.5 of PDF32000_2008.
+ * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference.
+ * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference.
+ * @param float|null $x Abscissa of the upper-left corner of the rectangle
+ * @param float|null $y Ordinate of the upper-left corner of the rectangle
+ * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered).
* @public
* @author Nicola Asuni
* @since 4.8.000 (2009-09-07)
*/
- public function Button($name, $w, $h, $caption, $action, $prop=array(), $opt=array(), $x='', $y='', $js=false) {
- if ($x === '') {
+ public function Button($name, $w, $h, $caption, $action, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
@@ -13214,7 +13272,7 @@ class TCPDF {
'R' => array('width' => $bw, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(51)),
'T' => array('width' => $bw, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(231)),
'B' => array('width' => $bw, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(51)));
- $this->SetFillColor(204);
+ $this->setFillColor(204);
$this->Cell($w, $h, $caption, $border, 0, 'C', true, '', 1, false, 'T', 'M');
$this->endTemplate();
--$this->n;
@@ -13420,14 +13478,14 @@ class TCPDF {
* WARNING: This is experimental and currently do not work.
* Check the PDF Reference 8.7.1 Transform Methods,
* Table 8.105 Entries in the UR transform parameters dictionary
- * @param $enable (boolean) if true enable user's rights on PDF reader
- * @param $document (string) Names specifying additional document-wide usage rights for the document. The only defined value is "/FullSave", which permits a user to save the document along with modified form and/or annotation data.
- * @param $annots (string) Names specifying additional annotation-related usage rights for the document. Valid names in PDF 1.5 and later are /Create/Delete/Modify/Copy/Import/Export, which permit the user to perform the named operation on annotations.
- * @param $form (string) Names specifying additional form-field-related usage rights for the document. Valid names are: /Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate
- * @param $signature (string) Names specifying additional signature-related usage rights for the document. The only defined value is /Modify, which permits a user to apply a digital signature to an existing signature form field or clear a signed signature form field.
- * @param $ef (string) Names specifying additional usage rights for named embedded files in the document. Valid names are /Create/Delete/Modify/Import, which permit the user to perform the named operation on named embedded files
+ * @param boolean $enable if true enable user's rights on PDF reader
+ * @param string $document Names specifying additional document-wide usage rights for the document. The only defined value is "/FullSave", which permits a user to save the document along with modified form and/or annotation data.
+ * @param string $annots Names specifying additional annotation-related usage rights for the document. Valid names in PDF 1.5 and later are /Create/Delete/Modify/Copy/Import/Export, which permit the user to perform the named operation on annotations.
+ * @param string $form Names specifying additional form-field-related usage rights for the document. Valid names are: /Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate
+ * @param string $signature Names specifying additional signature-related usage rights for the document. The only defined value is /Modify, which permits a user to apply a digital signature to an existing signature form field or clear a signed signature form field.
+ * @param string $ef Names specifying additional usage rights for named embedded files in the document. Valid names are /Create/Delete/Modify/Import, which permit the user to perform the named operation on named embedded files
Names specifying additional embedded-files-related usage rights for the document.
- * @param $formex (string) Names specifying additional form-field-related usage rights. The only valid name is BarcodePlaintext, which permits text form field data to be encoded as a plaintext two-dimensional barcode.
+ * @param string $formex Names specifying additional form-field-related usage rights. The only valid name is BarcodePlaintext, which permits text form field data to be encoded as a plaintext two-dimensional barcode.
* @public
* @author Nicola Asuni
* @since 2.9.000 (2008-03-26)
@@ -13458,13 +13516,13 @@ class TCPDF {
* To create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt
* To export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12
* To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes
- * @param $signing_cert (mixed) signing certificate (string or filename prefixed with 'file://')
- * @param $private_key (mixed) private key (string or filename prefixed with 'file://')
- * @param $private_key_password (string) password
- * @param $extracerts (string) specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used.
- * @param $cert_type (int) The access permissions granted for this document. Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature.
- * @param $info (array) array of option information: Name, Location, Reason, ContactInfo.
- * @param $approval (string) Enable approval signature eg. for PDF incremental update
+ * @param mixed $signing_cert signing certificate (string or filename prefixed with 'file://')
+ * @param mixed $private_key private key (string or filename prefixed with 'file://')
+ * @param string $private_key_password password
+ * @param string $extracerts specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used.
+ * @param int $cert_type The access permissions granted for this document. Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature.
+ * @param array $info array of option information: Name, Location, Reason, ContactInfo.
+ * @param string $approval Enable approval signature eg. for PDF incremental update
* @public
* @author Nicola Asuni
* @since 4.6.005 (2009-04-24)
@@ -13496,12 +13554,12 @@ class TCPDF {
/**
* Set the digital signature appearance (a cliccable rectangle area to get signature properties)
- * @param $x (float) Abscissa of the upper-left corner.
- * @param $y (float) Ordinate of the upper-left corner.
- * @param $w (float) Width of the signature area.
- * @param $h (float) Height of the signature area.
- * @param $page (int) option page number (if < 0 the current page is used).
- * @param $name (string) Name of the signature.
+ * @param float $x Abscissa of the upper-left corner.
+ * @param float $y Ordinate of the upper-left corner.
+ * @param float $w Width of the signature area.
+ * @param float $h Height of the signature area.
+ * @param int $page option page number (if < 0 the current page is used).
+ * @param string $name Name of the signature.
* @public
* @author Nicola Asuni
* @since 5.3.011 (2010-06-17)
@@ -13512,12 +13570,12 @@ class TCPDF {
/**
* Add an empty digital signature appearance (a cliccable rectangle area to get signature properties)
- * @param $x (float) Abscissa of the upper-left corner.
- * @param $y (float) Ordinate of the upper-left corner.
- * @param $w (float) Width of the signature area.
- * @param $h (float) Height of the signature area.
- * @param $page (int) option page number (if < 0 the current page is used).
- * @param $name (string) Name of the signature.
+ * @param float $x Abscissa of the upper-left corner.
+ * @param float $y Ordinate of the upper-left corner.
+ * @param float $w Width of the signature area.
+ * @param float $h Height of the signature area.
+ * @param int $page option page number (if < 0 the current page is used).
+ * @param string $name Name of the signature.
* @public
* @author Nicola Asuni
* @since 5.9.101 (2011-07-06)
@@ -13529,13 +13587,13 @@ class TCPDF {
/**
* Get the array that defines the signature appearance (page and rectangle coordinates).
- * @param $x (float) Abscissa of the upper-left corner.
- * @param $y (float) Ordinate of the upper-left corner.
- * @param $w (float) Width of the signature area.
- * @param $h (float) Height of the signature area.
- * @param $page (int) option page number (if < 0 the current page is used).
- * @param $name (string) Name of the signature.
- * @return (array) Array defining page and rectangle coordinates of signature appearance.
+ * @param float $x Abscissa of the upper-left corner.
+ * @param float $y Ordinate of the upper-left corner.
+ * @param float $w Width of the signature area.
+ * @param float $h Height of the signature area.
+ * @param int $page option page number (if < 0 the current page is used).
+ * @param string $name Name of the signature.
+ * @return array Array defining page and rectangle coordinates of signature appearance.
* @protected
* @author Nicola Asuni
* @since 5.9.101 (2011-07-06)
@@ -13564,10 +13622,10 @@ class TCPDF {
* Enable document timestamping (requires the OpenSSL Library).
* The trusted timestamping improve document security that means that no one should be able to change the document once it has been recorded.
* Use with digital signature only!
- * @param $tsa_host (string) Time Stamping Authority (TSA) server (prefixed with 'https://')
- * @param $tsa_username (string) Specifies the username for TSA authorization (optional) OR specifies the TSA authorization PEM file (see: example_66.php, optional)
- * @param $tsa_password (string) Specifies the password for TSA authorization (optional)
- * @param $tsa_cert (string) Specifies the location of TSA certificate for authorization (optional for cURL)
+ * @param string $tsa_host Time Stamping Authority (TSA) server (prefixed with 'https://')
+ * @param string $tsa_username Specifies the username for TSA authorization (optional) OR specifies the TSA authorization PEM file (see: example_66.php, optional)
+ * @param string $tsa_password Specifies the password for TSA authorization (optional)
+ * @param string $tsa_cert Specifies the location of TSA certificate for authorization (optional for cURL)
* @public
* @author Richard Stockinger
* @since 6.0.090 (2014-06-16)
@@ -13594,8 +13652,8 @@ class TCPDF {
/**
* NOT YET IMPLEMENTED
* Request TSA for a timestamp
- * @param $signature (string) Digital signature as binary string
- * @return (string) Timestamped digital signature
+ * @param string $signature Digital signature as binary string
+ * @return string Timestamped digital signature
* @protected
* @author Richard Stockinger
* @since 6.0.090 (2014-06-16)
@@ -13611,11 +13669,11 @@ class TCPDF {
/**
* Create a new page group.
* NOTE: call this function before calling AddPage()
- * @param $page (int) starting group page (leave empty for next page).
+ * @param int|null $page starting group page (leave empty for next page).
* @public
* @since 3.0.000 (2008-03-27)
*/
- public function startPageGroup($page='') {
+ public function startPageGroup($page=null) {
if (empty($page)) {
$page = $this->page + 1;
}
@@ -13624,7 +13682,7 @@ class TCPDF {
/**
* Set the starting page number.
- * @param $num (int) Starting page number.
+ * @param int $num Starting page number.
* @since 5.9.093 (2011-06-16)
* @public
*/
@@ -13691,7 +13749,7 @@ class TCPDF {
* Return the alias for the total number of pages in the current page group.
* If the current font is unicode type, the returned string is surrounded by additional curly braces.
* This alias will be replaced by the total number of pages in this group.
- * @return alias of the current page group
+ * @return string alias of the current page group
* @public
* @since 3.0.000 (2008-03-27)
*/
@@ -13706,7 +13764,7 @@ class TCPDF {
* Return the alias for the page number on the current page group.
* If the current font is unicode type, the returned string is surrounded by additional curly braces.
* This alias will be replaced by the page number (relative to the belonging group).
- * @return alias of the current page group
+ * @return string alias of the current page group
* @public
* @since 4.5.000 (2009-01-02)
*/
@@ -13719,7 +13777,7 @@ class TCPDF {
/**
* Return the current page in the group.
- * @return current page in the group
+ * @return int current page in the group
* @public
* @since 3.0.000 (2008-03-27)
*/
@@ -13773,10 +13831,10 @@ class TCPDF {
/**
* Start a new pdf layer.
- * @param $name (string) Layer name (only a-z letters and numbers). Leave empty for automatic name.
- * @param $print (boolean|null) Set to TRUE to print this layer, FALSE to not print and NULL to not set this option
- * @param $view (boolean) Set to true to view this layer.
- * @param $lock (boolean) If true lock the layer
+ * @param string $name Layer name (only a-z letters and numbers). Leave empty for automatic name.
+ * @param boolean|null $print Set to TRUE to print this layer, FALSE to not print and NULL to not set this option
+ * @param boolean $view Set to true to view this layer.
+ * @param boolean $lock If true lock the layer
* @public
* @since 5.9.102 (2011-07-13)
*/
@@ -13815,7 +13873,7 @@ class TCPDF {
* Set the visibility of the successive elements.
* This can be useful, for instance, to put a background
* image or color that will show on screen but won't print.
- * @param $v (string) visibility mode. Legal values are: all, print, screen or view.
+ * @param string $v visibility mode. Legal values are: all, print, screen or view.
* @public
* @since 3.0.000 (2008-03-27)
*/
@@ -13847,13 +13905,13 @@ class TCPDF {
/**
* Add transparency parameters to the current extgstate
- * @param $parms (array) parameters
- * @return the number of extgstates
+ * @param array $parms parameters
+ * @return int|void the number of extgstates
* @protected
* @since 3.0.000 (2008-03-27)
*/
protected function addExtGState($parms) {
- if ($this->pdfa_mode) {
+ if ($this->pdfa_mode || $this->pdfa_version >= 2) {
// transparencies are not allowed in PDF/A mode
return;
}
@@ -13879,13 +13937,13 @@ class TCPDF {
/**
* Add an extgstate
- * @param $gs (array) extgstate
+ * @param int $gs extgstate
* @protected
* @since 3.0.000 (2008-03-27)
*/
protected function setExtGState($gs) {
- if ($this->pdfa_mode OR ($this->state != 2)) {
- // transparency is not allowed in PDF/A mode
+ if (($this->pdfa_mode && $this->pdfa_version < 2) OR ($this->state != 2)) {
+ // transparency is not allowed in PDF/A-1 mode
return;
}
$this->_out(sprintf('/GS%d gs', $gs));
@@ -13919,13 +13977,13 @@ class TCPDF {
/**
* Set overprint mode for stroking (OP) and non-stroking (op) painting operations.
* (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).
- * @param $stroking (boolean) If true apply overprint for stroking operations.
- * @param $nonstroking (boolean) If true apply overprint for painting operations other than stroking.
- * @param $mode (integer) Overprint mode: (0 = each source colour component value replaces the value previously painted for the corresponding device colorant; 1 = a tint value of 0.0 for a source colour component shall leave the corresponding component of the previously painted colour unchanged).
+ * @param boolean $stroking If true apply overprint for stroking operations.
+ * @param boolean|null $nonstroking If true apply overprint for painting operations other than stroking.
+ * @param integer $mode Overprint mode: (0 = each source colour component value replaces the value previously painted for the corresponding device colorant; 1 = a tint value of 0.0 for a source colour component shall leave the corresponding component of the previously painted colour unchanged).
* @public
* @since 5.9.152 (2012-03-23)
*/
- public function setOverprint($stroking=true, $nonstroking='', $mode=0) {
+ public function setOverprint($stroking=true, $nonstroking=null, $mode=0) {
if ($this->state != 2) {
return;
}
@@ -13947,7 +14005,7 @@ class TCPDF {
/**
* Get the overprint mode array (OP, op, OPM).
* (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).
- * @return array.
+ * @return array
* @public
* @since 5.9.152 (2012-03-23)
*/
@@ -13957,16 +14015,16 @@ class TCPDF {
/**
* Set alpha for stroking (CA) and non-stroking (ca) operations.
- * @param $stroking (float) Alpha value for stroking operations: real value from 0 (transparent) to 1 (opaque).
- * @param $bm (string) blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity
- * @param $nonstroking (float) Alpha value for non-stroking operations: real value from 0 (transparent) to 1 (opaque).
- * @param $ais (boolean)
+ * @param float $stroking Alpha value for stroking operations: real value from 0 (transparent) to 1 (opaque).
+ * @param string $bm blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity
+ * @param float|null $nonstroking Alpha value for non-stroking operations: real value from 0 (transparent) to 1 (opaque).
+ * @param boolean $ais
* @public
* @since 3.0.000 (2008-03-27)
*/
- public function setAlpha($stroking=1, $bm='Normal', $nonstroking='', $ais=false) {
- if ($this->pdfa_mode) {
- // transparency is not allowed in PDF/A mode
+ public function setAlpha($stroking=1, $bm='Normal', $nonstroking=null, $ais=false) {
+ if ($this->pdfa_mode && $this->pdfa_version < 2) {
+ // transparency is not allowed in PDF/A-1 mode
return;
}
$stroking = floatval($stroking);
@@ -13992,7 +14050,7 @@ class TCPDF {
/**
* Get the alpha mode array (CA, ca, BM, AIS).
* (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).
- * @return array.
+ * @return array
* @public
* @since 5.9.152 (2012-03-23)
*/
@@ -14002,7 +14060,7 @@ class TCPDF {
/**
* Set the default JPEG compression quality (1-100)
- * @param $quality (int) JPEG quality, integer between 1 and 100
+ * @param int $quality JPEG quality, integer between 1 and 100
* @public
* @since 3.0.000 (2008-03-27)
*/
@@ -14015,7 +14073,7 @@ class TCPDF {
/**
* Set the default number of columns in a row for HTML tables.
- * @param $cols (int) number of columns
+ * @param int $cols number of columns
* @public
* @since 3.0.014 (2008-06-04)
*/
@@ -14025,7 +14083,7 @@ class TCPDF {
/**
* Set the height of the cell (line height) respect the font height.
- * @param $h (int) cell proportion respect font height (typical value = 1.25).
+ * @param float $h cell proportion respect font height (typical value = 1.25).
* @public
* @since 3.0.014 (2008-06-04)
*/
@@ -14036,6 +14094,7 @@ class TCPDF {
/**
* return the height of cell repect font height.
* @public
+ * @return float
* @since 4.0.012 (2008-07-24)
*/
public function getCellHeightRatio() {
@@ -14044,15 +14103,18 @@ class TCPDF {
/**
* Set the PDF version (check PDF reference for valid values).
- * @param $version (string) PDF document version.
+ * @param string $version PDF document version.
* @public
* @since 3.1.000 (2008-06-09)
*/
public function setPDFVersion($version='1.7') {
if ($this->pdfa_mode && $this->pdfa_version == 1 ) {
- // PDF/A mode
+ // PDF/A-1 mode
$this->PDFVersion = '1.4';
- } else {
+ } elseif ($this->pdfa_mode && $this->pdfa_version >= 2 ) {
+ // PDF/A-2 mode
+ $this->PDFVersion = '1.7';
+ } else {
$this->PDFVersion = $version;
}
}
@@ -14061,7 +14123,7 @@ class TCPDF {
* Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print.
* (see Section 8.1 of PDF reference, "Viewer Preferences").
*
HideToolbar boolean (Optional) A flag specifying whether to hide the viewer application's tool bars when the document is active. Default value: false.
HideMenubar boolean (Optional) A flag specifying whether to hide the viewer application's menu bar when the document is active. Default value: false.
HideWindowUI boolean (Optional) A flag specifying whether to hide user interface elements in the document's window (such as scroll bars and navigation controls), leaving only the document's contents displayed. Default value: false.
FitWindow boolean (Optional) A flag specifying whether to resize the document's window to fit the size of the first displayed page. Default value: false.
CenterWindow boolean (Optional) A flag specifying whether to position the document's window in the center of the screen. Default value: false.
DisplayDocTitle boolean (Optional; PDF 1.4) A flag specifying whether the window's title bar should display the document title taken from the Title entry of the document information dictionary (see Section 10.2.1, "Document Information Dictionary"). If false, the title bar should instead display the name of the PDF file containing the document. Default value: false.
NonFullScreenPageMode name (Optional) The document's page mode, specifying how to display the document on exiting full-screen mode:
UseNone Neither document outline nor thumbnail images visible
UseOutlines Document outline visible
UseThumbs Thumbnail images visible
UseOC Optional content group panel visible
This entry is meaningful only if the value of the PageMode entry in the catalog dictionary (see Section 3.6.1, "Document Catalog") is FullScreen; it is ignored otherwise. Default value: UseNone.
ViewArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be displayed when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:
MediaBox
CropBox (default)
BleedBox
TrimBox
ArtBox
ViewClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:
MediaBox
CropBox (default)
BleedBox
TrimBox
ArtBox
PrintArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be rendered when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:
MediaBox
CropBox (default)
BleedBox
TrimBox
ArtBox
PrintClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:
MediaBox
CropBox (default)
BleedBox
TrimBox
ArtBox
PrintScaling name (Optional; PDF 1.6) The page scaling option to be selected when a print dialog is displayed for this document. Valid values are:
None, which indicates that the print dialog should reflect no page scaling
AppDefault (default), which indicates that applications should use the current print scaling
Duplex name (Optional; PDF 1.7) The paper handling option to use when printing the file from the print dialog. The following values are valid:
Simplex - Print single-sided
DuplexFlipShortEdge - Duplex and flip on the short edge of the sheet
DuplexFlipLongEdge - Duplex and flip on the long edge of the sheet
Default value: none
PickTrayByPDFSize boolean (Optional; PDF 1.7) A flag specifying whether the PDF page size is used to select the input paper tray. This setting influences only the preset values used to populate the print dialog presented by a PDF viewer application. If PickTrayByPDFSize is true, the check box in the print dialog associated with input paper tray is checked. Note: This setting has no effect on Mac OS systems, which do not provide the ability to pick the input tray by size.
PrintPageRange array (Optional; PDF 1.7) The page numbers used to initialize the print dialog box when the file is printed. The first page of the PDF file is denoted by 1. Each pair consists of the first and last pages in the sub-range. An odd number of integers causes this entry to be ignored. Negative numbers cause the entire array to be ignored. Default value: as defined by PDF viewer application
NumCopies integer (Optional; PDF 1.7) The number of copies to be printed when the print dialog is opened for this file. Supported values are the integers 2 through 5. Values outside this range are ignored. Default value: as defined by PDF viewer application, but typically 1
- * @param $preferences (array) array of options.
+ * @param array $preferences array of options.
* @author Nicola Asuni
* @public
* @since 3.1.000 (2008-06-09)
@@ -14072,13 +14134,13 @@ class TCPDF {
/**
* Paints color transition registration bars
- * @param $x (float) abscissa of the top left corner of the rectangle.
- * @param $y (float) ordinate of the top left corner of the rectangle.
- * @param $w (float) width of the rectangle.
- * @param $h (float) height of the rectangle.
- * @param $transition (boolean) if true prints tcolor transitions to white.
- * @param $vertical (boolean) if true prints bar vertically.
- * @param $colors (string) colors to print separated by comma. Valid values are: A,W,R,G,B,C,M,Y,K,RGB,CMYK,ALL,ALLSPOT,. Where: A = grayscale black, W = grayscale white, R = RGB red, G RGB green, B RGB blue, C = CMYK cyan, M = CMYK magenta, Y = CMYK yellow, K = CMYK key/black, RGB = RGB registration color, CMYK = CMYK registration color, ALL = Spot registration color, ALLSPOT = print all defined spot colors, = name of the spot color to print.
+ * @param float $x abscissa of the top left corner of the rectangle.
+ * @param float $y ordinate of the top left corner of the rectangle.
+ * @param float $w width of the rectangle.
+ * @param float $h height of the rectangle.
+ * @param boolean $transition if true prints tcolor transitions to white.
+ * @param boolean $vertical if true prints bar vertically.
+ * @param string $colors colors to print separated by comma. Valid values are: A,W,R,G,B,C,M,Y,K,RGB,CMYK,ALL,ALLSPOT,. Where: A = grayscale black, W = grayscale white, R = RGB red, G RGB green, B RGB blue, C = CMYK cyan, M = CMYK magenta, Y = CMYK yellow, K = CMYK key/black, RGB = RGB registration color, CMYK = CMYK registration color, ALL = Spot registration color, ALLSPOT = print all defined spot colors, = name of the spot color to print.
* @author Nicola Asuni
* @since 4.9.000 (2010-03-26)
* @public
@@ -14201,7 +14263,7 @@ class TCPDF {
// color gradient
$this->LinearGradient($xb, $yb, $wb, $hb, $col_a, $col_b, $coords);
} else {
- $this->SetFillColorArray($col_b);
+ $this->setFillColorArray($col_b);
// colored rectangle
$this->Rect($xb, $yb, $wb, $hb, 'F', array());
}
@@ -14213,18 +14275,18 @@ class TCPDF {
/**
* Paints crop marks.
- * @param $x (float) abscissa of the crop mark center.
- * @param $y (float) ordinate of the crop mark center.
- * @param $w (float) width of the crop mark.
- * @param $h (float) height of the crop mark.
- * @param $type (string) type of crop mark, one symbol per type separated by comma: T = TOP, F = BOTTOM, L = LEFT, R = RIGHT, TL = A = TOP-LEFT, TR = B = TOP-RIGHT, BL = C = BOTTOM-LEFT, BR = D = BOTTOM-RIGHT.
- * @param $color (array) crop mark color (default spot registration color).
+ * @param float $x abscissa of the crop mark center.
+ * @param float $y ordinate of the crop mark center.
+ * @param float $w width of the crop mark.
+ * @param float $h height of the crop mark.
+ * @param string $type type of crop mark, one symbol per type separated by comma: T = TOP, F = BOTTOM, L = LEFT, R = RIGHT, TL = A = TOP-LEFT, TR = B = TOP-RIGHT, BL = C = BOTTOM-LEFT, BR = D = BOTTOM-RIGHT.
+ * @param array $color crop mark color (default spot registration color).
* @author Nicola Asuni
* @since 4.9.000 (2010-03-26)
* @public
*/
public function cropMark($x, $y, $w, $h, $type='T,R,B,L', $color=array(100,100,100,100,'All')) {
- $this->SetLineStyle(array('width' => (0.5 / $this->k), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $color));
+ $this->setLineStyle(array('width' => (0.5 / $this->k), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $color));
$type = strtoupper($type);
$type = preg_replace('/[^A-Z\-\,]*/', '', $type);
// split type in single components
@@ -14284,28 +14346,28 @@ class TCPDF {
/**
* Paints a registration mark
- * @param $x (float) abscissa of the registration mark center.
- * @param $y (float) ordinate of the registration mark center.
- * @param $r (float) radius of the crop mark.
- * @param $double (boolean) if true print two concentric crop marks.
- * @param $cola (array) crop mark color (default spot registration color 'All').
- * @param $colb (array) second crop mark color (default spot registration color 'None').
+ * @param float $x abscissa of the registration mark center.
+ * @param float $y ordinate of the registration mark center.
+ * @param float $r radius of the crop mark.
+ * @param boolean $double if true print two concentric crop marks.
+ * @param array $cola crop mark color (default spot registration color 'All').
+ * @param array $colb second crop mark color (default spot registration color 'None').
* @author Nicola Asuni
* @since 4.9.000 (2010-03-26)
* @public
*/
public function registrationMark($x, $y, $r, $double=false, $cola=array(100,100,100,100,'All'), $colb=array(0,0,0,0,'None')) {
$line_style = array('width' => max((0.5 / $this->k),($r / 30)), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $cola);
- $this->SetFillColorArray($cola);
+ $this->setFillColorArray($cola);
$this->PieSector($x, $y, $r, 90, 180, 'F');
$this->PieSector($x, $y, $r, 270, 360, 'F');
$this->Circle($x, $y, $r, 0, 360, 'C', $line_style, array(), 8);
if ($double) {
$ri = $r * 0.5;
- $this->SetFillColorArray($colb);
+ $this->setFillColorArray($colb);
$this->PieSector($x, $y, $ri, 90, 180, 'F');
$this->PieSector($x, $y, $ri, 270, 360, 'F');
- $this->SetFillColorArray($cola);
+ $this->setFillColorArray($cola);
$this->PieSector($x, $y, $ri, 0, 90, 'F');
$this->PieSector($x, $y, $ri, 180, 270, 'F');
$this->Circle($x, $y, $ri, 0, 360, 'C', $line_style, array(), 8);
@@ -14314,9 +14376,9 @@ class TCPDF {
/**
* Paints a CMYK registration mark
- * @param $x (float) abscissa of the registration mark center.
- * @param $y (float) ordinate of the registration mark center.
- * @param $r (float) radius of the crop mark.
+ * @param float $x abscissa of the registration mark center.
+ * @param float $y ordinate of the registration mark center.
+ * @param float $r radius of the crop mark.
* @author Nicola Asuni
* @since 6.0.038 (2013-09-30)
* @public
@@ -14329,20 +14391,20 @@ class TCPDF {
// external radius
$re = ($r * 1.3);
// Cyan
- $this->SetFillColorArray(array(100,0,0,0));
+ $this->setFillColorArray(array(100,0,0,0));
$this->PieSector($x, $y, $ri, 270, 360, 'F');
// Magenta
- $this->SetFillColorArray(array(0,100,0,0));
+ $this->setFillColorArray(array(0,100,0,0));
$this->PieSector($x, $y, $ri, 0, 90, 'F');
// Yellow
- $this->SetFillColorArray(array(0,0,100,0));
+ $this->setFillColorArray(array(0,0,100,0));
$this->PieSector($x, $y, $ri, 90, 180, 'F');
// Key - black
- $this->SetFillColorArray(array(0,0,0,100));
+ $this->setFillColorArray(array(0,0,0,100));
$this->PieSector($x, $y, $ri, 180, 270, 'F');
// registration color
$line_style = array('width' => $lw, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(100,100,100,100,'All'));
- $this->SetFillColorArray(array(100,100,100,100,'All'));
+ $this->setFillColorArray(array(100,100,100,100,'All'));
// external circle
$this->Circle($x, $y, $r, 0, 360, 'C', $line_style, array(), 8);
// cross lines
@@ -14354,13 +14416,13 @@ class TCPDF {
/**
* Paints a linear colour gradient.
- * @param $x (float) abscissa of the top left corner of the rectangle.
- * @param $y (float) ordinate of the top left corner of the rectangle.
- * @param $w (float) width of the rectangle.
- * @param $h (float) height of the rectangle.
- * @param $col1 (array) first color (Grayscale, RGB or CMYK components).
- * @param $col2 (array) second color (Grayscale, RGB or CMYK components).
- * @param $coords (array) array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0).
+ * @param float $x abscissa of the top left corner of the rectangle.
+ * @param float $y ordinate of the top left corner of the rectangle.
+ * @param float $w width of the rectangle.
+ * @param float $h height of the rectangle.
+ * @param array $col1 first color (Grayscale, RGB or CMYK components).
+ * @param array $col2 second color (Grayscale, RGB or CMYK components).
+ * @param array $coords array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0).
* @author Andreas W\FCrmser, Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @public
@@ -14372,13 +14434,13 @@ class TCPDF {
/**
* Paints a radial colour gradient.
- * @param $x (float) abscissa of the top left corner of the rectangle.
- * @param $y (float) ordinate of the top left corner of the rectangle.
- * @param $w (float) width of the rectangle.
- * @param $h (float) height of the rectangle.
- * @param $col1 (array) first color (Grayscale, RGB or CMYK components).
- * @param $col2 (array) second color (Grayscale, RGB or CMYK components).
- * @param $coords (array) array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined.
+ * @param float $x abscissa of the top left corner of the rectangle.
+ * @param float $y ordinate of the top left corner of the rectangle.
+ * @param float $w width of the rectangle.
+ * @param float $h height of the rectangle.
+ * @param array $col1 first color (Grayscale, RGB or CMYK components).
+ * @param array $col2 second color (Grayscale, RGB or CMYK components).
+ * @param array $coords array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined.
* @author Andreas W\FCrmser, Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @public
@@ -14390,24 +14452,24 @@ class TCPDF {
/**
* Paints a coons patch mesh.
- * @param $x (float) abscissa of the top left corner of the rectangle.
- * @param $y (float) ordinate of the top left corner of the rectangle.
- * @param $w (float) width of the rectangle.
- * @param $h (float) height of the rectangle.
- * @param $col1 (array) first color (lower left corner) (RGB components).
- * @param $col2 (array) second color (lower right corner) (RGB components).
- * @param $col3 (array) third color (upper right corner) (RGB components).
- * @param $col4 (array) fourth color (upper left corner) (RGB components).
- * @param $coords (array)
for one patch mesh: array(float x1, float y1, .... float x12, float y12): 12 pairs of coordinates (normally from 0 to 1) which specify the Bezier control points that define the patch. First pair is the lower left edge point, next is its right control point (control point 2). Then the other points are defined in the order: control point 1, edge point, control point 2 going counter-clockwise around the patch. Last (x12, y12) is the first edge point's left control point (control point 1).
for two or more patch meshes: array[number of patches]: arrays with the following keys for each patch: f: where to put that patch (0 = first patch, 1, 2, 3 = right, top and left of precedent patch - I didn't figure this out completely - just try and error ;-) points: 12 pairs of coordinates of the Bezier control points as above for the first patch, 8 pairs of coordinates for the following patches, ignoring the coordinates already defined by the precedent patch (I also didn't figure out the order of these - also: try and see what's happening) colors: must be 4 colors for the first patch, 2 colors for the following patches
- * @param $coords_min (array) minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0
- * @param $coords_max (array) maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1
- * @param $antialias (boolean) A flag indicating whether to filter the shading function to prevent aliasing artifacts.
+ * @param float $x abscissa of the top left corner of the rectangle.
+ * @param float $y ordinate of the top left corner of the rectangle.
+ * @param float $w width of the rectangle.
+ * @param float $h height of the rectangle.
+ * @param array $col1 first color (lower left corner) (RGB components).
+ * @param array $col2 second color (lower right corner) (RGB components).
+ * @param array $col3 third color (upper right corner) (RGB components).
+ * @param array $col4 fourth color (upper left corner) (RGB components).
+ * @param array $coords
for one patch mesh: array(float x1, float y1, .... float x12, float y12): 12 pairs of coordinates (normally from 0 to 1) which specify the Bezier control points that define the patch. First pair is the lower left edge point, next is its right control point (control point 2). Then the other points are defined in the order: control point 1, edge point, control point 2 going counter-clockwise around the patch. Last (x12, y12) is the first edge point's left control point (control point 1).
for two or more patch meshes: array[number of patches]: arrays with the following keys for each patch: f: where to put that patch (0 = first patch, 1, 2, 3 = right, top and left of precedent patch - I didn't figure this out completely - just try and error ;-) points: 12 pairs of coordinates of the Bezier control points as above for the first patch, 8 pairs of coordinates for the following patches, ignoring the coordinates already defined by the precedent patch (I also didn't figure out the order of these - also: try and see what's happening) colors: must be 4 colors for the first patch, 2 colors for the following patches
+ * @param array $coords_min minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0
+ * @param array $coords_max maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1
+ * @param boolean $antialias A flag indicating whether to filter the shading function to prevent aliasing artifacts.
* @author Andreas W\FCrmser, Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @public
*/
public function CoonsPatchMesh($x, $y, $w, $h, $col1=array(), $col2=array(), $col3=array(), $col4=array(), $coords=array(0.00,0.0,0.33,0.00,0.67,0.00,1.00,0.00,1.00,0.33,1.00,0.67,1.00,1.00,0.67,1.00,0.33,1.00,0.00,1.00,0.00,0.67,0.00,0.33), $coords_min=0, $coords_max=1, $antialias=false) {
- if ($this->pdfa_mode OR ($this->state != 2)) {
+ if (($this->pdfa_mode && $this->pdfa_version < 2) OR ($this->state != 2)) {
return;
}
$this->Clip($x, $y, $w, $h);
@@ -14467,8 +14529,8 @@ class TCPDF {
if ($patch_array[$i]['points'][$j] > $bpcd) {
$patch_array[$i]['points'][$j] = $bpcd;
}
- $this->gradients[$n]['stream'] .= chr(floor($patch_array[$i]['points'][$j] / 256));
- $this->gradients[$n]['stream'] .= chr(floor($patch_array[$i]['points'][$j] % 256));
+ $this->gradients[$n]['stream'] .= chr((int) floor($patch_array[$i]['points'][$j] / 256));
+ $this->gradients[$n]['stream'] .= chr((int) floor(intval($patch_array[$i]['points'][$j]) % 256));
}
$count_cols = count($patch_array[$i]['colors']);
for ($j=0; $j < $count_cols; ++$j) {
@@ -14490,10 +14552,10 @@ class TCPDF {
/**
* Set a rectangular clipping area.
- * @param $x (float) abscissa of the top left corner of the rectangle (or top right corner for RTL mode).
- * @param $y (float) ordinate of the top left corner of the rectangle.
- * @param $w (float) width of the rectangle.
- * @param $h (float) height of the rectangle.
+ * @param float $x abscissa of the top left corner of the rectangle (or top right corner for RTL mode).
+ * @param float $y ordinate of the top left corner of the rectangle.
+ * @param float $w width of the rectangle.
+ * @param float $h height of the rectangle.
* @author Andreas W\FCrmser, Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @protected
@@ -14516,17 +14578,17 @@ class TCPDF {
/**
* Output gradient.
- * @param $type (int) type of gradient (1 Function-based shading; 2 Axial shading; 3 Radial shading; 4 Free-form Gouraud-shaded triangle mesh; 5 Lattice-form Gouraud-shaded triangle mesh; 6 Coons patch mesh; 7 Tensor-product patch mesh). (Not all types are currently supported)
- * @param $coords (array) array of coordinates.
- * @param $stops (array) array gradient color components: color = array of GRAY, RGB or CMYK color components; offset = (0 to 1) represents a location along the gradient vector; exponent = exponent of the exponential interpolation function (default = 1).
- * @param $background (array) An array of colour components appropriate to the colour space, specifying a single background colour value.
- * @param $antialias (boolean) A flag indicating whether to filter the shading function to prevent aliasing artifacts.
+ * @param int $type type of gradient (1 Function-based shading; 2 Axial shading; 3 Radial shading; 4 Free-form Gouraud-shaded triangle mesh; 5 Lattice-form Gouraud-shaded triangle mesh; 6 Coons patch mesh; 7 Tensor-product patch mesh). (Not all types are currently supported)
+ * @param array $coords array of coordinates.
+ * @param array $stops array gradient color components: color = array of GRAY, RGB or CMYK color components; offset = (0 to 1) represents a location along the gradient vector; exponent = exponent of the exponential interpolation function (default = 1).
+ * @param array $background An array of colour components appropriate to the colour space, specifying a single background colour value.
+ * @param boolean $antialias A flag indicating whether to filter the shading function to prevent aliasing artifacts.
* @author Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @public
*/
public function Gradient($type, $coords, $stops, $background=array(), $antialias=false) {
- if ($this->pdfa_mode OR ($this->state != 2)) {
+ if (($this->pdfa_mode && $this->pdfa_version < 2) OR ($this->state != 2)) {
return;
}
$n = count($this->gradients) + 1;
@@ -14582,7 +14644,7 @@ class TCPDF {
}
if (isset($stop['opacity'])) {
$this->gradients[$n]['colors'][$key]['opacity'] = $stop['opacity'];
- if ((!$this->pdfa_mode) AND ($stop['opacity'] < 1)) {
+ if ((!($this->pdfa_mode && $this->pdfa_version < 2)) AND ($stop['opacity'] < 1)) {
$this->gradients[$n]['transparency'] = true;
}
} else {
@@ -14633,7 +14695,7 @@ class TCPDF {
* @protected
*/
function _putshaders() {
- if ($this->pdfa_mode) {
+ if ($this->pdfa_mode && $this->pdfa_version < 2) {
return;
}
$idt = count($this->gradients); //index for transparency gradients
@@ -14812,14 +14874,14 @@ class TCPDF {
/**
* Draw the sector of a circle.
* It can be used for instance to render pie charts.
- * @param $xc (float) abscissa of the center.
- * @param $yc (float) ordinate of the center.
- * @param $r (float) radius.
- * @param $a (float) start angle (in degrees).
- * @param $b (float) end angle (in degrees).
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $cw: (float) indicates whether to go clockwise (default: true).
- * @param $o: (float) origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). Default: 90.
+ * @param float $xc abscissa of the center.
+ * @param float $yc ordinate of the center.
+ * @param float $r radius.
+ * @param float $a start angle (in degrees).
+ * @param float $b end angle (in degrees).
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param float $cw indicates whether to go clockwise (default: true).
+ * @param float $o origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). Default: 90.
* @author Maxime Delorme, Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @public
@@ -14831,16 +14893,16 @@ class TCPDF {
/**
* Draw the sector of an ellipse.
* It can be used for instance to render pie charts.
- * @param $xc (float) abscissa of the center.
- * @param $yc (float) ordinate of the center.
- * @param $rx (float) the x-axis radius.
- * @param $ry (float) the y-axis radius.
- * @param $a (float) start angle (in degrees).
- * @param $b (float) end angle (in degrees).
- * @param $style (string) Style of rendering. See the getPathPaintOperator() function for more information.
- * @param $cw: (float) indicates whether to go clockwise.
- * @param $o: (float) origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock).
- * @param $nc (integer) Number of curves used to draw a 90 degrees portion of arc.
+ * @param float $xc abscissa of the center.
+ * @param float $yc ordinate of the center.
+ * @param float $rx the x-axis radius.
+ * @param float $ry the y-axis radius.
+ * @param float $a start angle (in degrees).
+ * @param float $b end angle (in degrees).
+ * @param string $style Style of rendering. See the getPathPaintOperator() function for more information.
+ * @param float $cw indicates whether to go clockwise.
+ * @param float $o origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock).
+ * @param integer $nc Number of curves used to draw a 90 degrees portion of arc.
* @author Maxime Delorme, Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @public
@@ -14873,23 +14935,23 @@ class TCPDF {
* NOTE: EPS is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library.
* Only vector drawing is supported, not text or bitmap.
* Although the script was successfully tested with various AI format versions, best results are probably achieved with files that were exported in the AI3 format (tested with Illustrator CS2, Freehand MX and Photoshop CS2).
- * @param $file (string) Name of the file containing the image or a '@' character followed by the EPS/AI data string.
- * @param $x (float) Abscissa of the upper-left corner.
- * @param $y (float) Ordinate of the upper-left corner.
- * @param $w (float) Width of the image in the page. If not specified or equal to zero, it is automatically calculated.
- * @param $h (float) Height of the image in the page. If not specified or equal to zero, it is automatically calculated.
- * @param $link (mixed) URL or identifier returned by AddLink().
- * @param $useBoundingBox (boolean) specifies whether to position the bounding box (true) or the complete canvas (false) at location (x,y). Default value is true.
- * @param $align (string) Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
T: top-right for LTR or top-left for RTL
M: middle-right for LTR or middle-left for RTL
B: bottom-right for LTR or bottom-left for RTL
N: next line
- * @param $palign (string) Allows to center or align the image on the current line. Possible values are:
L : left align
C : center
R : right align
'' : empty string : left for LTR or right for RTL
- * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
- * @param $fitonpage (boolean) if true the image is resized to not exceed page dimensions.
- * @param $fixoutvals (boolean) if true remove values outside the bounding box.
+ * @param string $file Name of the file containing the image or a '@' character followed by the EPS/AI data string.
+ * @param float|null $x Abscissa of the upper-left corner.
+ * @param float|null $y Ordinate of the upper-left corner.
+ * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated.
+ * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated.
+ * @param mixed $link URL or identifier returned by AddLink().
+ * @param boolean $useBoundingBox specifies whether to position the bounding box (true) or the complete canvas (false) at location (x,y). Default value is true.
+ * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
T: top-right for LTR or top-left for RTL
M: middle-right for LTR or middle-left for RTL
B: bottom-right for LTR or bottom-left for RTL
N: next line
+ * @param string $palign Allows to center or align the image on the current line. Possible values are:
L : left align
C : center
R : right align
'' : empty string : left for LTR or right for RTL
+ * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
0: no border (default)
1: frame
or a string containing some or all of the following characters (in any order):
L: left
T: top
R: right
B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * @param boolean $fitonpage if true the image is resized to not exceed page dimensions.
+ * @param boolean $fixoutvals if true remove values outside the bounding box.
* @author Valentin Schmidt, Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @public
*/
- public function ImageEps($file, $x='', $y='', $w=0, $h=0, $link='', $useBoundingBox=true, $align='', $palign='', $border=0, $fitonpage=false, $fixoutvals=false) {
+ public function ImageEps($file, $x=null, $y=null, $w=0, $h=0, $link='', $useBoundingBox=true, $align='', $palign='', $border=0, $fitonpage=false, $fixoutvals=false) {
if ($this->state != 2) {
return;
}
@@ -14897,10 +14959,10 @@ class TCPDF {
// convert EPS to raster image using GD or ImageMagick libraries
return $this->Image($file, $x, $y, $w, $h, 'EPS', $link, $align, true, 300, $palign, false, false, $border, false, false, $fitonpage);
}
- if ($x === '') {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
@@ -14909,7 +14971,7 @@ class TCPDF {
if ($file[0] === '@') { // image from string
$data = substr($file, 1);
} else { // EPS/AI file
- $data = TCPDF_STATIC::fileGetContents($file);
+ $data = $this->getCachedFileContents($file);
}
if ($data === FALSE) {
$this->Error('EPS file not found: '.$file);
@@ -15193,7 +15255,7 @@ class TCPDF {
break;
}
case 'N':{
- $this->SetY($this->img_rb_y);
+ $this->setY($this->img_rb_y);
break;
}
default:{
@@ -15205,7 +15267,7 @@ class TCPDF {
/**
* Set document barcode.
- * @param $bc (string) barcode
+ * @param string $bc barcode
* @public
*/
public function setBarcode($bc='') {
@@ -15224,14 +15286,14 @@ class TCPDF {
/**
* Print a Linear Barcode.
- * @param $code (string) code to print
- * @param $type (string) type of barcode (see tcpdf_barcodes_1d.php for supported formats).
- * @param $x (int) x position in user units (empty string = current x position)
- * @param $y (int) y position in user units (empty string = current y position)
- * @param $w (int) width in user units (empty string = remaining page width)
- * @param $h (int) height in user units (empty string = remaining page height)
- * @param $xres (float) width of the smallest bar in user units (empty string = default value = 0.4mm)
- * @param $style (array) array of options:
+ * @param string $code code to print
+ * @param string $type type of barcode (see tcpdf_barcodes_1d.php for supported formats).
+ * @param float|null $x x position in user units (null = current x position)
+ * @param float|null $y y position in user units (null = current y position)
+ * @param float|null $w width in user units (null = remaining page width)
+ * @param float|null $h height in user units (null = remaining page height)
+ * @param float|null $xres width of the smallest bar in user units (null = default value = 0.4mm)
+ * @param array $style array of options:
*
boolean $style['border'] if true prints a border
*
int $style['padding'] padding to leave around the barcode in user units (set to 'auto' for automatic padding)
*
int $style['hpadding'] horizontal padding in user units (set to 'auto' for automatic padding)
@@ -15247,12 +15309,12 @@ class TCPDF {
*
string $style['stretch'] if true stretch the barcode to best fit the available width, otherwise uses $xres resolution for a single bar.
*
string $style['fitwidth'] if true reduce the width to fit the barcode width + padding. When this option is enabled the 'stretch' option is automatically disabled.
*
string $style['cellfitalign'] this option works only when 'fitwidth' is true and 'position' is unset or empty. Set the horizontal position of the containing barcode cell inside the specified rectangle: L = left; C = center; R = right.
- * @param $align (string) Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:
T: top-right for LTR or top-left for RTL
M: middle-right for LTR or middle-left for RTL
B: bottom-right for LTR or bottom-left for RTL
N: next line
+ * @param string $align Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:
T: top-right for LTR or top-left for RTL
M: middle-right for LTR or middle-left for RTL
B: bottom-right for LTR or bottom-left for RTL
N: next line
* @author Nicola Asuni
* @since 3.1.000 (2008-06-09)
* @public
*/
- public function write1DBarcode($code, $type, $x='', $y='', $w='', $h='', $xres='', $style=array(), $align='') {
+ public function write1DBarcode($code, $type, $x=null, $y=null, $w=null, $h=null, $xres=null, $style=array(), $align='') {
if (TCPDF_STATIC::empty_string(trim($code))) {
return;
}
@@ -15262,7 +15324,7 @@ class TCPDF {
// create new barcode object
$barcodeobj = new TCPDFBarcode($code, $type);
$arrcode = $barcodeobj->getBarcodeArray();
- if (($arrcode === false) OR empty($arrcode) OR ($arrcode['maxw'] <= 0)) {
+ if (empty($arrcode) OR ($arrcode['maxw'] <= 0)) {
$this->Error('Error in 1D barcode string');
}
if ($arrcode['maxh'] <= 0) {
@@ -15311,20 +15373,20 @@ class TCPDF {
if (isset($style['fontsize'])) {
$fontsize = $style['fontsize'];
}
- $this->SetFont($style['font'], '', $fontsize);
+ $this->setFont($style['font'], '', $fontsize);
}
if (!isset($style['stretchtext'])) {
$style['stretchtext'] = 4;
}
- if ($x === '') {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
list($x, $y) = $this->checkPageRegions($h, $x, $y);
- if (($w === '') OR ($w <= 0)) {
+ if (TCPDF_STATIC::empty_string($w) OR ($w <= 0)) {
if ($this->rtl) {
$w = $x - $this->lMargin;
} else {
@@ -15408,7 +15470,7 @@ class TCPDF {
}
$text_height = $this->getCellHeight($fontsize / $this->k);
// height
- if (($h === '') OR ($h <= 0)) {
+ if (TCPDF_STATIC::empty_string($h) OR ($h <= 0)) {
// set default height
$h = (($arrcode['maxw'] * $xres) / 3) + (2 * $vpadding) + $text_height;
}
@@ -15418,7 +15480,7 @@ class TCPDF {
if ($text_height > $h) {
$fontsize = (($h * $this->k) / (4 * $this->cell_height_ratio));
$text_height = $this->getCellHeight($fontsize / $this->k);
- $this->SetFont($style['font'], '', $fontsize);
+ $this->setFont($style['font'], '', $fontsize);
}
if ($vpadding > 0) {
$vpadding = (($h - $text_height) / 4);
@@ -15483,8 +15545,8 @@ class TCPDF {
$this->Rect($xpos_rect, $y, $w, $h, 'D');
}
// set foreground color
- $this->SetDrawColorArray($style['fgcolor']);
- $this->SetTextColorArray($style['fgcolor']);
+ $this->setDrawColorArray($style['fgcolor']);
+ $this->setTextColorArray($style['fgcolor']);
// print bars
foreach ($arrcode['bcode'] as $k => $v) {
$bw = ($v['w'] * $xres);
@@ -15510,8 +15572,8 @@ class TCPDF {
$this->x = $xpos_text;
$this->y = $y + $vpadding + $barh;
$cellpadding = $this->cell_padding;
- $this->SetCellPadding(0);
- $this->Cell($txtwidth, '', $label, 0, 0, 'C', false, '', $style['stretchtext'], false, 'T', 'T');
+ $this->setCellPadding(0);
+ $this->Cell($txtwidth, 0, $label, 0, 0, 'C', false, '', $style['stretchtext'], false, 'T', 'T');
$this->cell_padding = $cellpadding;
}
// restore original direction
@@ -15536,7 +15598,7 @@ class TCPDF {
break;
}
case 'N':{
- $this->SetY($this->img_rb_y);
+ $this->setY($this->img_rb_y);
break;
}
default:{
@@ -15548,13 +15610,13 @@ class TCPDF {
/**
* Print 2D Barcode.
- * @param $code (string) code to print
- * @param $type (string) type of barcode (see tcpdf_barcodes_2d.php for supported formats).
- * @param $x (int) x position in user units
- * @param $y (int) y position in user units
- * @param $w (int) width in user units
- * @param $h (int) height in user units
- * @param $style (array) array of options:
+ * @param string $code code to print
+ * @param string $type type of barcode (see tcpdf_barcodes_2d.php for supported formats).
+ * @param float|null $x x position in user units
+ * @param float|null $y y position in user units
+ * @param float|null $w width in user units
+ * @param float|null $h height in user units
+ * @param array $style array of options:
*
boolean $style['border'] if true prints a border around the barcode
*
int $style['padding'] padding to leave around the barcode in barcode units (set to 'auto' for automatic padding)
*
int $style['hpadding'] horizontal padding in barcode units (set to 'auto' for automatic padding)
@@ -15564,13 +15626,13 @@ class TCPDF {
*
array $style['fgcolor'] color array for bars and text
*
mixed $style['bgcolor'] color array for background or false for transparent
*
string $style['position'] barcode position on the page: L = left margin; C = center; R = right margin; S = stretch
- * @param $align (string) Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:
T: top-right for LTR or top-left for RTL
M: middle-right for LTR or middle-left for RTL
B: bottom-right for LTR or bottom-left for RTL
N: next line
- * @param $distort (boolean) if true distort the barcode to fit width and height, otherwise preserve aspect ratio
+ * @param string $align Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:
T: top-right for LTR or top-left for RTL
M: middle-right for LTR or middle-left for RTL
B: bottom-right for LTR or bottom-left for RTL
N: next line
+ * @param boolean $distort if true distort the barcode to fit width and height, otherwise preserve aspect ratio
* @author Nicola Asuni
* @since 4.5.037 (2009-04-07)
* @public
*/
- public function write2DBarcode($code, $type, $x='', $y='', $w='', $h='', $style=array(), $align='', $distort=false) {
+ public function write2DBarcode($code, $type, $x=null, $y=null, $w=null, $h=null, $style=array(), $align='', $distort=false) {
if (TCPDF_STATIC::empty_string(trim($code))) {
return;
}
@@ -15580,7 +15642,7 @@ class TCPDF {
// create new barcode object
$barcodeobj = new TCPDF2DBarcode($code, $type);
$arrcode = $barcodeobj->getBarcodeArray();
- if (($arrcode === false) OR empty($arrcode) OR !isset($arrcode['num_rows']) OR ($arrcode['num_rows'] == 0) OR !isset($arrcode['num_cols']) OR ($arrcode['num_cols'] == 0)) {
+ if (empty($arrcode) OR !isset($arrcode['num_rows']) OR ($arrcode['num_rows'] == 0) OR !isset($arrcode['num_cols']) OR ($arrcode['num_cols'] == 0)) {
$this->Error('Error in 2D barcode string');
}
// set default values
@@ -15621,10 +15683,10 @@ class TCPDF {
if (!isset($style['module_height'])) {
$style['module_height'] = 1; // height of a single module in points
}
- if ($x === '') {
+ if (TCPDF_STATIC::empty_string($x)) {
$x = $this->x;
}
- if ($y === '') {
+ if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
@@ -15666,7 +15728,7 @@ class TCPDF {
$h = $maxh;
}
// set dimensions
- if ((($w === '') OR ($w <= 0)) AND (($h === '') OR ($h <= 0))) {
+ if ((TCPDF_STATIC::empty_string($w) OR ($w <= 0)) AND (TCPDF_STATIC::empty_string($h) OR ($h <= 0))) {
$w = ($cols + $hpad) * ($mw / $this->k);
$h = ($rows + $vpad) * ($mh / $this->k);
} elseif (($w === '') OR ($w <= 0)) {
@@ -15733,7 +15795,7 @@ class TCPDF {
$this->Rect($xpos, $y, $w, $h, 'D');
}
// set foreground color
- $this->SetDrawColorArray($style['fgcolor']);
+ $this->setDrawColorArray($style['fgcolor']);
// print barcode cells
// for each row
for ($r = 0; $r < $rows; ++$r) {
@@ -15770,7 +15832,7 @@ class TCPDF {
break;
}
case 'N':{
- $this->SetY($this->img_rb_y);
+ $this->setY($this->img_rb_y);
break;
}
default:{
@@ -15836,7 +15898,7 @@ class TCPDF {
/**
* Returns the current font size.
- * @return current font size
+ * @return float current font size
* @public
* @since 3.2.000 (2008-06-23)
*/
@@ -15846,7 +15908,7 @@ class TCPDF {
/**
* Returns the current font size in points unit.
- * @return current font size in points unit
+ * @return int current font size in points unit
* @public
* @since 3.2.000 (2008-06-23)
*/
@@ -15876,23 +15938,23 @@ class TCPDF {
/**
* Cleanup HTML code (requires HTML Tidy library).
- * @param $html (string) htmlcode to fix
- * @param $default_css (string) CSS commands to add
- * @param $tagvs (array) parameters for setHtmlVSpace method
- * @param $tidy_options (array) options for tidy_parse_string function
+ * @param string $html htmlcode to fix
+ * @param string $default_css CSS commands to add
+ * @param array|null $tagvs parameters for setHtmlVSpace method
+ * @param array|null $tidy_options options for tidy_parse_string function
* @return string XHTML code cleaned up
* @author Nicola Asuni
* @public
* @since 5.9.017 (2010-11-16)
* @see setHtmlVSpace()
*/
- public function fixHTMLCode($html, $default_css='', $tagvs='', $tidy_options='') {
+ public function fixHTMLCode($html, $default_css='', $tagvs=null, $tidy_options=null) {
return TCPDF_STATIC::fixHTMLCode($html, $default_css, $tagvs, $tidy_options, $this->tagvspaces);
}
/**
* Returns the border width from CSS property
- * @param $width (string) border width
+ * @param string $width border width
* @return int with in user units
* @protected
* @since 5.7.000 (2010-08-02)
@@ -15912,7 +15974,7 @@ class TCPDF {
/**
* Returns the border dash style from CSS property
- * @param $style (string) border style to convert
+ * @param string $style border style to convert
* @return int sash style (return -1 in case of none or hidden border)
* @protected
* @since 5.7.000 (2010-08-02)
@@ -15948,7 +16010,7 @@ class TCPDF {
/**
* Returns the border style array from CSS border properties
- * @param $cssborder (string) border properties
+ * @param string $cssborder border properties
* @return array containing border properties
* @protected
* @since 5.7.000 (2010-08-02)
@@ -15998,8 +16060,8 @@ class TCPDF {
/**
* Get the internal Cell padding from CSS attribute.
- * @param $csspadding (string) padding properties
- * @param $width (float) width of the containing element
+ * @param string $csspadding padding properties
+ * @param float $width width of the containing element
* @return array of cell paddings
* @public
* @since 5.9.000 (2010-10-04)
@@ -16052,8 +16114,8 @@ class TCPDF {
/**
* Get the internal Cell margin from CSS attribute.
- * @param $cssmargin (string) margin properties
- * @param $width (float) width of the containing element
+ * @param string $cssmargin margin properties
+ * @param float $width width of the containing element
* @return array of cell margins
* @public
* @since 5.9.000 (2010-10-04)
@@ -16106,8 +16168,8 @@ class TCPDF {
/**
* Get the border-spacing from CSS attribute.
- * @param $cssbspace (string) border-spacing CSS properties
- * @param $width (float) width of the containing element
+ * @param string $cssbspace border-spacing CSS properties
+ * @param float $width width of the containing element
* @return array of border spacings
* @public
* @since 5.9.010 (2010-10-27)
@@ -16140,8 +16202,8 @@ class TCPDF {
/**
* Returns the letter-spacing value from CSS value
- * @param $spacing (string) letter-spacing value
- * @param $parent (float) font spacing (tracking) value of the parent element
+ * @param string $spacing letter-spacing value
+ * @param float $parent font spacing (tracking) value of the parent element
* @return float quantity to increases or decreases the space between characters in a text.
* @protected
* @since 5.9.000 (2010-10-02)
@@ -16171,8 +16233,8 @@ class TCPDF {
/**
* Returns the percentage of font stretching from CSS value
- * @param $stretch (string) stretch mode
- * @param $parent (float) stretch value of the parent element
+ * @param string $stretch stretch mode
+ * @param float $parent stretch value of the parent element
* @return float font stretching percentage
* @protected
* @since 5.9.000 (2010-10-02)
@@ -16242,10 +16304,10 @@ class TCPDF {
/**
* Convert HTML string containing font size value to points
- * @param $val (string) String containing font size value and unit.
- * @param $refsize (float) Reference font size in points.
- * @param $parent_size (float) Parent font size in points.
- * @param $defaultunit (string) Default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt).
+ * @param string $val String containing font size value and unit.
+ * @param float $refsize Reference font size in points.
+ * @param float $parent_size Parent font size in points.
+ * @param string $defaultunit Default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt).
* @return float value in points
* @public
*/
@@ -16298,7 +16360,7 @@ class TCPDF {
/**
* Returns the HTML DOM array.
- * @param $html (string) html code
+ * @param string $html html code
* @return array
* @protected
* @since 3.2.000 (2008-06-20)
@@ -16308,15 +16370,15 @@ class TCPDF {
$css = array();
// get CSS array defined at previous call
$matches = array();
- if (preg_match_all('/([^\<]*)<\/cssarray>/isU', $html, $matches) > 0) {
+ if (preg_match_all('/([^\<]*?)<\/cssarray>/is', $html, $matches) > 0) {
if (isset($matches[1][0])) {
$css = array_merge($css, json_decode($this->unhtmlentities($matches[1][0]), true));
}
- $html = preg_replace('/(.*?)<\/cssarray>/isU', '', $html);
+ $html = preg_replace('/(.*?)<\/cssarray>/is', '', $html);
}
// extract external CSS files
$matches = array();
- if (preg_match_all('/]*)>/isU', $html, $matches) > 0) {
+ if (preg_match_all('/]*?)>/is', $html, $matches) > 0) {
foreach ($matches[1] as $key => $link) {
$type = array();
if (preg_match('/type[\s]*=[\s]*"text\/css"/', $link, $type)) {
@@ -16328,7 +16390,7 @@ class TCPDF {
$type = array();
if (preg_match('/href[\s]*=[\s]*"([^"]*)"/', $link, $type) > 0) {
// read CSS data file
- $cssdata = TCPDF_STATIC::fileGetContents(trim($type[1]));
+ $cssdata = $this->getCachedFileContents(trim($type[1]));
if (($cssdata !== FALSE) AND (strlen($cssdata) > 0)) {
$css = array_merge($css, TCPDF_STATIC::extractCSSproperties($cssdata));
}
@@ -16339,7 +16401,7 @@ class TCPDF {
}
// extract style tags
$matches = array();
- if (preg_match_all('/