20201112
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
399
vendor/tecnickcom/tcpdf/include/barcodes/qrcode.php
vendored
399
vendor/tecnickcom/tcpdf/include/barcodes/qrcode.php
vendored
@@ -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: <ul><li>L : About 7% or less errors can be corrected.</li><li>M : About 15% or less errors can be corrected.</li><li>Q : About 25% or less errors can be corrected.</li><li>H : About 30% or less errors can be corrected.</li></ul>
|
||||
* @param string $code code to represent using QRcode
|
||||
* @param string $eclevel error level: <ul><li>L : About 7% or less errors can be corrected.</li><li>M : About 15% or less errors can be corrected.</li><li>Q : About 25% or less errors can be corrected.</li><li>H : About 30% or less errors can be corrected.</li></ul>
|
||||
* @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:<ul><li>mm = Bits per symbol;</li><li>nn = Symbols per block;</li><li>alpha_to = log lookup table array;</li><li>index_of = Antilog lookup table array;</li><li>genpoly = Generator polynomial array;</li><li>nroots = Number of generator;</li><li>roots = number of parity symbols;</li><li>fcr = First consecutive root, index form;</li><li>prim = Primitive element, index form;</li><li>iprim = prim-th root of 1, index form;</li><li>pad = Padding bytes in shortened block;</li><li>gfpoly</ul>.
|
||||
*/
|
||||
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:<ul><li>mm = Bits per symbol;</li><li>nn = Symbols per block;</li><li>alpha_to = log lookup table array;</li><li>index_of = Antilog lookup table array;</li><li>genpoly = Generator polynomial array;</li><li>nroots = Number of generator;</li><li>roots = number of parity symbols;</li><li>fcr = First consecutive root, index form;</li><li>prim = Primitive element, index form;</li><li>iprim = prim-th root of 1, index form;</li><li>pad = Padding bytes in shortened block;</li><li>gfpoly</ul>.
|
||||
*/
|
||||
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) {
|
||||
|
||||
22
vendor/tecnickcom/tcpdf/include/tcpdf_colors.php
vendored
22
vendor/tecnickcom/tcpdf/include/tcpdf_colors.php
vendored
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
176
vendor/tecnickcom/tcpdf/include/tcpdf_fonts.php
vendored
176
vendor/tecnickcom/tcpdf/include/tcpdf_fonts.php
vendored
@@ -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
|
||||
* </pre>
|
||||
* @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<br>
|
||||
* @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<br>
|
||||
* @param $unicode (array) array containing UTF-8 unicode values
|
||||
* @return array
|
||||
* Converts UTF-8 characters array to Latin1 string<br>
|
||||
* @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.<br>
|
||||
* 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
|
||||
* ---------------------------------------------------------------------
|
||||
* </pre>
|
||||
* @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.<br>
|
||||
* Invalid byte sequences will be replaced with 0xFFFD (replacement character)<br>
|
||||
* @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.<br>
|
||||
* @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.<br>
|
||||
* @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
|
||||
|
||||
37
vendor/tecnickcom/tcpdf/include/tcpdf_images.php
vendored
37
vendor/tecnickcom/tcpdf/include/tcpdf_images.php
vendored
@@ -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) {
|
||||
|
||||
323
vendor/tecnickcom/tcpdf/include/tcpdf_static.php
vendored
323
vendor/tecnickcom/tcpdf/include/tcpdf_static.php
vendored
@@ -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.2';
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
* <li>UTF-8 (hex): 0xC2 0xAD (c2ad)</li>
|
||||
* <li>UTF-8 character: chr(194).chr(173)</li>
|
||||
* </ul>
|
||||
* @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:<ul><li>0: no border (default)</li><li>1: frame</li></ul>or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> 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:<ul><li>0: no border (default)</li><li>1: frame</li></ul>or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> 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
|
||||
@@ -457,11 +460,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 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
|
||||
@@ -480,11 +483,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
|
||||
@@ -527,8 +530,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 +567,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 +589,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 +606,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 +623,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 +645,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 +655,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 +1014,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 +1026,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 +1039,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,18 +1130,18 @@ 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 $tagvs parameters for setHtmlVSpace method
|
||||
* @param array $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 === '') {
|
||||
$tidy_options = array (
|
||||
@@ -1195,9 +1200,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 +1360,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 +1407,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 +1438,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 +1506,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 +1522,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 +1555,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:
|
||||
* <ul>
|
||||
* <li>S or D: Stroke the path.</li>
|
||||
* <li>s or d: Close and stroke the path.</li>
|
||||
@@ -1560,7 +1569,8 @@ class TCPDF_STATIC {
|
||||
* <li>CEO: Clipping mode using the nonzero winding number rule to determine which regions lie inside the clipping path</li>
|
||||
* <li>n: End the path object without filling or stroking it.</li>
|
||||
* </ul>
|
||||
* @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 +1647,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 +1667,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 +1762,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 +1787,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 +1820,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 +1836,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 +1856,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);
|
||||
@@ -1859,7 +1877,7 @@ class TCPDF_STATIC {
|
||||
public static function encodeUrlQuery($url) {
|
||||
$urlData = parse_url($url);
|
||||
if (isset($urlData['query']) && $urlData['query']) {
|
||||
$urlQueryData = [];
|
||||
$urlQueryData = array();
|
||||
parse_str(urldecode($urlData['query']), $urlQueryData);
|
||||
$updatedUrl = $urlData['scheme'] . '://' . $urlData['host'] . $urlData['path'] . '?' . http_build_query($urlQueryData);
|
||||
} else {
|
||||
@@ -1872,8 +1890,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 +1907,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 +1991,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 +2007,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 +2021,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 +2035,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 +2049,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 +2066,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 +2080,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 +2098,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 +2112,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 +2133,8 @@ class TCPDF_STATIC {
|
||||
|
||||
/**
|
||||
* Read a 4-byte (32 bit) integer from file.
|
||||
* @param $f (string) file name.
|
||||
* @return 4-byte integer
|
||||
* @param string $f file name.
|
||||
* @return int 4-byte integer
|
||||
* @public static
|
||||
*/
|
||||
public static function _freadint($f) {
|
||||
@@ -2120,11 +2142,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<string,float[]>
|
||||
*/
|
||||
public static $page_formats = array(
|
||||
// ISO 216 A Series + 2 SIS 014711 extensions
|
||||
@@ -2480,7 +2503,7 @@ class TCPDF_STATIC {
|
||||
|
||||
/**
|
||||
* Get page dimensions from format name.
|
||||
* @param $format (mixed) The format name @see self::$page_format<ul>
|
||||
* @param mixed $format The format name @see self::$page_format<ul>
|
||||
* @return array containing page width and height in points
|
||||
* @since 5.0.010 (2010-05-17)
|
||||
* @public static
|
||||
@@ -2494,20 +2517,20 @@ class TCPDF_STATIC {
|
||||
|
||||
/**
|
||||
* Set page boundaries.
|
||||
* @param $page (int) page number
|
||||
* @param $type (string) valid values are: <ul><li>'MediaBox' : the boundaries of the physical medium on which the page shall be displayed or printed;</li><li>'CropBox' : the visible region of default user space;</li><li>'BleedBox' : the region to which the contents of the page shall be clipped when output in a production environment;</li><li>'TrimBox' : the intended dimensions of the finished page after trimming;</li><li>'ArtBox' : the page's meaningful content (including potential white space).</li></ul>
|
||||
* @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: <ul><li>'MediaBox' : the boundaries of the physical medium on which the page shall be displayed or printed;</li><li>'CropBox' : the visible region of default user space;</li><li>'BleedBox' : the region to which the contents of the page shall be clipped when output in a production environment;</li><li>'TrimBox' : the intended dimensions of the finished page after trimming;</li><li>'ArtBox' : the page's meaningful content (including potential white space).</li></ul>
|
||||
* @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 +2550,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 +2573,8 @@ class TCPDF_STATIC {
|
||||
|
||||
/**
|
||||
* Get the canonical page layout mode.
|
||||
* @param $layout (string) The page layout. Possible values are:<ul><li>SinglePage Display one page at a time</li><li>OneColumn Display the pages in one column</li><li>TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left</li><li>TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right</li><li>TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left</li><li>TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right</li></ul>
|
||||
* @return (string) Canonical page layout name.
|
||||
* @param string $layout The page layout. Possible values are:<ul><li>SinglePage Display one page at a time</li><li>OneColumn Display the pages in one column</li><li>TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left</li><li>TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right</li><li>TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left</li><li>TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right</li></ul>
|
||||
* @return string Canonical page layout name.
|
||||
* @public static
|
||||
*/
|
||||
public static function getPageLayoutMode($layout='SinglePage') {
|
||||
@@ -2593,8 +2616,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:<ul><li>UseNone Neither document outline nor thumbnail images visible</li><li>UseOutlines Document outline visible</li><li>UseThumbs Thumbnail images visible</li><li>FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible</li><li>UseOC (PDF 1.5) Optional content group panel visible</li><li>UseAttachments (PDF 1.6) Attachments panel visible</li></ul>
|
||||
* @return (string) Canonical page mode name.
|
||||
* @param string $mode A name object specifying how the document should be displayed when opened:<ul><li>UseNone Neither document outline nor thumbnail images visible</li><li>UseOutlines Document outline visible</li><li>UseThumbs Thumbnail images visible</li><li>FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible</li><li>UseOC (PDF 1.5) Optional content group panel visible</li><li>UseAttachments (PDF 1.6) Attachments panel visible</li></ul>
|
||||
* @return string Canonical page mode name.
|
||||
* @public static
|
||||
*/
|
||||
public static function getPageMode($mode='UseNone') {
|
||||
|
||||
Reference in New Issue
Block a user