Merge branch 'wip_MDL-47300_m28_tcpdf' of https://github.com/skodak/moodle
This commit is contained in:
@@ -1,3 +1,121 @@
|
||||
6.0.093 (2014-09-02)
|
||||
- Security fix: some serialize/unserialize methods were replaced with json_encode/json_decode to avoid a potential object injection with user supplied content. Thanks to ownCloud Inc. for reporting this issue.
|
||||
- K_TIMEZONE constant was added to the default configuration to supress date-time warnings.
|
||||
|
||||
6.0.092 (2014-09-01)
|
||||
- Bug item #956 "Monospaced fonts are not alignd at the baseline" was fixed.
|
||||
- Bug item #964 "Problem when changing font size" was fixed.
|
||||
- Bug item #969 "ImageSVG with radialGradient problem" was fixed.
|
||||
- sRGB.icc file was replaced with the one from the Debian package icc-profiles-free (2.0.1+dfsg-1)
|
||||
|
||||
6.0.091 (2014-08-13)
|
||||
- Issue #325"Division by zero when css fontsize equals 0" was fixed.
|
||||
|
||||
6.0.090 (2014-08-08)
|
||||
- Starting from this version TCPDF is also available in GitHub at https://github.com/tecnickcom/TCPDF
|
||||
- Function getmypid() was removed for better compatibility with shared hosting environments.
|
||||
- Support for pulling SVG stroke opacity value from RGBa color was mergeg [adf006].
|
||||
- Bug item #951 "HTML Table within TCPDF columns doesnt flow correctly on page break ..." was fixed.
|
||||
|
||||
6.0.089 (2014-07-16)
|
||||
- Bug item #948 "bottom line of rowspan cell not work correctly" was fixed.
|
||||
|
||||
6.0.088 (2014-07-09)
|
||||
- Bug item #946 "Case sensitive type check causes broken match for SVG" was fixed.
|
||||
- Bug item #945 "Imagick load doesn't account for passed data string " was fixed.
|
||||
|
||||
6.0.087 (2014-06-25)
|
||||
- A bug affecting fitcell option in Multicell was fixed.
|
||||
|
||||
6.0.086 (2014-06-20)
|
||||
- Bug item #938 "Hyphenation-dash extends outside of cell" was fixed (collateral effect).
|
||||
|
||||
6.0.085 (2014-06-19)
|
||||
- Some example images were replaced.
|
||||
- A race condition bug was fixed.
|
||||
- Bug item #938 "Hyphenation-dash extends outside of cell" was fixed.
|
||||
|
||||
6.0.084 (2014-06-13)
|
||||
- A bug related to MultiCell fitcell feature was fixed.
|
||||
- Bug item #931 "Documentation error for setPageFormat()" was fixed.
|
||||
|
||||
6.0.083 (2014-05-29)
|
||||
- Bug item #928 "setHtmlVSpace with HR element" was fixed.
|
||||
|
||||
6.0.082 (2014-05-23)
|
||||
- Bug item #926 "test statement instead of assignment used in tcpdf_fonts.php" was fixed.
|
||||
- Bug item #925 "924 transparent images bug" was fixed.
|
||||
|
||||
6.0.081 (2014-05-22)
|
||||
- Bug item #922 "writehtml tables thead repeating" was fixed.
|
||||
- Patch #71 "External and internal links, local and remote" wa applied.
|
||||
|
||||
6.0.080 (2014-05-20)
|
||||
- Bug item #921 "Fatal error in hyphenateText() function" was fixed.
|
||||
- Bug item #923 "Automatic Hyphenation error" was fixed.
|
||||
- Patch #70 "Augument TCPDFBarcode classes with ability to return raw png image data" was applied.
|
||||
|
||||
6.0.079 (2014-05-19)
|
||||
- Patch item #69 "Named destinations, HTML internal and external links" was merged.
|
||||
- Bug item #920 "hyphenateText() should not hyphenate the content of style-tags in HTML mode" was fixed.
|
||||
- Image method now trigs an error in case the cache is now writeable.
|
||||
- Fixed issue with layer default status.
|
||||
|
||||
6.0.078 (2014-05-12)
|
||||
- A warning issue in addTTFfont() method was fixed.
|
||||
- Fonts were updated to include cbbox metrics.
|
||||
|
||||
6.0.077 (2014-05-06)
|
||||
- A Datamatrix barcode bug was fixed.
|
||||
|
||||
6.0.076 (2014-05-06)
|
||||
- A bug in Datamatrix Base256 encoding was fixed.
|
||||
- Merged fix for SVG use/clip-gradient.
|
||||
- Now it is possible to prefix a page number in Link methods with the * character to avoid been changed when adding/deleting/moving pages (see example_045.php).
|
||||
|
||||
6.0.075 (2014-05-05)
|
||||
- Bug #917 "Using realtive Units like ex or em for images distort output in HTML mode" was fixed.
|
||||
|
||||
6.0.074 (2014-05-03)
|
||||
- Part of Bug #917 "Using realtive Units like ex or em for images distort output in HTML mode" was fixed.
|
||||
- Bug #915 "Problem with SVG Image using Radial Gradients" was fixed.
|
||||
|
||||
6.0.073 (2014-04-29)
|
||||
- Bug #913 "Possible bug with line-height" was fixed.
|
||||
- Bug #914 "MultiCell and FitCell" was fixed.
|
||||
- Bug #915 "Problem with SVG Image using Radial Gradients" was fixed.
|
||||
|
||||
6.0.072 (2014-04-27)
|
||||
- Deprecated curly braces substring syntax was replaced with square braces.
|
||||
|
||||
6.0.071 (2014-04-25)
|
||||
- Bug #911 "error with buffered png pics" was fixed.
|
||||
|
||||
6.0.070 (2014-04-24)
|
||||
- Bug #910 "An SVG image is being cut off (with clipping mask) when you use align options" was fixed.
|
||||
|
||||
6.0.069 (2014-04-24)
|
||||
- Datamatrix Base256 encoding was fixed.
|
||||
|
||||
6.0.068 (2014-04-22)
|
||||
- Some Datamatrix barcode bugs were fixed.
|
||||
|
||||
6.0.067 (2014-04-21)
|
||||
- startLayer() method signature was changed to include a new "lock" parameter.
|
||||
|
||||
6.0.066 (2014-04-20)
|
||||
- Bug #908 "Linebreak is not considered when getting length of the next string" was fixed.
|
||||
|
||||
6.0.065 (2014-04-10)
|
||||
- Bug #905 "RGB percentage color bug in convertHTMLColorToDec()" was fixed.
|
||||
|
||||
6.0.064 (2014-04-07)
|
||||
- Header and Footer fonts are now set by default.
|
||||
- Bug #904 "PDF corrupted" was fixed.
|
||||
|
||||
6.0.063 (2014-04-03)
|
||||
- Method TCPDF_IMAGES::_parsepng() was fixed to support transparency in Indexed images.
|
||||
|
||||
6.0.062 (2014-03-02)
|
||||
- The method startLayer() now accepts the NULL value for the $print parameter to not set the print layer option.
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
|
||||
------------------------------------------------------------
|
||||
|
||||
Name: TCPDF
|
||||
Version: 6.0.062
|
||||
Release date: 2014-03-02
|
||||
Version: 6.0.093
|
||||
Release date: 2014-09-02
|
||||
Author: Nicola Asuni
|
||||
|
||||
Copyright (c) 2002-2014:
|
||||
@@ -107,5 +107,9 @@ Third party fonts:
|
||||
The binary files (.z) that begins with the prefix "ae" have been extracted from the Arabeyes.org collection (GNU-GPLv2).
|
||||
Link : http://projects.arabeyes.org/
|
||||
|
||||
ICC profile:
|
||||
TCPDF includes the sRGB.icc profile from the icc-profiles-free Debian package:
|
||||
https://packages.debian.org/source/stable/icc-profiles-free
|
||||
|
||||
|
||||
============================================================
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "tecnick.com/tcpdf",
|
||||
"version": "6.0.062",
|
||||
"version": "6.0.093",
|
||||
"homepage": "http://www.tcpdf.org/",
|
||||
"type": "library",
|
||||
"description": "TCPDF is a PHP class for generating PDF documents.",
|
||||
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
|
||||
"keywords": ["PDF","tcpdf","PDFD32000-2008","qrcode","datamatrix","pdf417","barcodes"],
|
||||
"license": "LGPLv3",
|
||||
"authors": [
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//============================================================+
|
||||
// File name : tcpdf_config.php
|
||||
// Begin : 2004-06-11
|
||||
// Last Update : 2014-01-25
|
||||
// Last Update : 2014-09-02
|
||||
//
|
||||
// Description : Configuration file for TCPDF.
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
|
||||
@@ -217,6 +217,11 @@ define('K_TCPDF_CALLS_IN_HTML', true);
|
||||
*/
|
||||
define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
|
||||
|
||||
/**
|
||||
* Default timezone for datetime functions
|
||||
*/
|
||||
define('K_TIMEZONE', 'UTC');
|
||||
|
||||
//============================================================+
|
||||
// END OF FILE
|
||||
//============================================================+
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : datamatrix.php
|
||||
// Version : 1.0.004
|
||||
// Version : 1.0.008
|
||||
// Begin : 2010-06-07
|
||||
// Last Update : 2013-12-12
|
||||
// Last Update : 2014-05-06
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
// Copyright (C) 2010-2012 Nicola Asuni - Tecnick.com LTD
|
||||
// Copyright (C) 2010-2014 Nicola Asuni - Tecnick.com LTD
|
||||
//
|
||||
// This file is part of TCPDF software library.
|
||||
//
|
||||
@@ -40,7 +40,7 @@
|
||||
*
|
||||
* @package com.tecnick.tcpdf
|
||||
* @author Nicola Asuni
|
||||
* @version 1.0.004
|
||||
* @version 1.0.008
|
||||
*/
|
||||
|
||||
// custom definitions
|
||||
@@ -256,14 +256,16 @@ class Datamatrix {
|
||||
return false;
|
||||
} elseif ($params[11] > $nd) {
|
||||
// add padding
|
||||
if ($this->last_enc == ENC_EDF) {
|
||||
// switch to ASCII encoding
|
||||
$cw[] = 124;
|
||||
++$nd;
|
||||
} elseif (($this->last_enc != ENC_ASCII) AND ($this->last_enc != ENC_BASE256)) {
|
||||
// switch to ASCII encoding
|
||||
$cw[] = 254;
|
||||
++$nd;
|
||||
if ((($params[11] - $nd) > 1) AND ($cw[($nd - 1)] != 254)) {
|
||||
if ($this->last_enc == ENC_EDF) {
|
||||
// switch to ASCII encoding
|
||||
$cw[] = 124;
|
||||
++$nd;
|
||||
} elseif (($this->last_enc != ENC_ASCII) AND ($this->last_enc != ENC_BASE256)) {
|
||||
// switch to ASCII encoding
|
||||
$cw[] = 254;
|
||||
++$nd;
|
||||
}
|
||||
}
|
||||
if ($params[11] > $nd) {
|
||||
// add first pad
|
||||
@@ -652,6 +654,9 @@ class Datamatrix {
|
||||
switch ($mode) {
|
||||
case ENC_ASCII: { // ASCII character 0 to 127
|
||||
$cw = 254;
|
||||
if ($this->last_enc == ENC_EDF) {
|
||||
$cw = 124;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ENC_C40: { // Upper-case alphanumeric
|
||||
@@ -707,6 +712,8 @@ class Datamatrix {
|
||||
$cw_num = 0; // number of data codewords
|
||||
$data_lenght = strlen($data); // number of chars
|
||||
while ($pos < $data_lenght) {
|
||||
// set last used encoding
|
||||
$this->last_enc = $enc;
|
||||
switch ($enc) {
|
||||
case ENC_ASCII: { // STEP B. While in ASCII encodation
|
||||
if (($data_lenght > 1) AND ($pos < ($data_lenght - 1)) AND ($this->isCharMode(ord($data[$pos]), ENC_ASCII_NUM) AND $this->isCharMode(ord($data[$pos + 1]), ENC_ASCII_NUM))) {
|
||||
@@ -799,7 +806,13 @@ class Datamatrix {
|
||||
// 1. If the C40 encoding is at the point of starting a new double symbol character and if the look-ahead test (starting at step J) indicates another mode, switch to that mode.
|
||||
$newenc = $this->lookAheadTest($data, $pos, $enc);
|
||||
if ($newenc != $enc) {
|
||||
// switch to new encoding
|
||||
$enc = $newenc;
|
||||
if ($enc != ENC_ASCII) {
|
||||
// set unlatch character
|
||||
$cw[] = $this->getSwitchEncodingCodeword(ENC_ASCII);
|
||||
++$cw_num;
|
||||
}
|
||||
$cw[] = $this->getSwitchEncodingCodeword($enc);
|
||||
++$cw_num;
|
||||
$pos -= $p;
|
||||
@@ -811,20 +824,26 @@ class Datamatrix {
|
||||
// process last data (if any)
|
||||
if ($p > 0) {
|
||||
// get remaining number of data symbols
|
||||
$cwr = ($this->getMaxDataCodewords($cw_num + 2) - $cw_num);
|
||||
$cwr = ($this->getMaxDataCodewords($cw_num) - $cw_num);
|
||||
if (($cwr == 1) AND ($p == 1)) {
|
||||
// d. If one symbol character remains and one C40 value (data character) remains to be encoded
|
||||
$c1 = array_shift($temp_cw);
|
||||
--$p;
|
||||
$cw[] = ($c1 + 1);
|
||||
$cw[] = ($chr + 1);
|
||||
++$cw_num;
|
||||
$pos = $epos;
|
||||
$enc = ENC_ASCII;
|
||||
$this->last_enc = $enc;
|
||||
} elseif (($cwr == 2) AND ($p == 1)) {
|
||||
// c. If two symbol characters remain and only one C40 value (data character) remains to be encoded
|
||||
$c1 = array_shift($temp_cw);
|
||||
--$p;
|
||||
$cw[] = 254;
|
||||
$cw[] = ($c1 + 1);
|
||||
$cw[] = ($chr + 1);
|
||||
$cw_num += 2;
|
||||
$pos = $epos;
|
||||
$enc = ENC_ASCII;
|
||||
$this->last_enc = $enc;
|
||||
} elseif (($cwr == 2) AND ($p == 2)) {
|
||||
// b. If two symbol characters remain and two C40 values remain to be encoded
|
||||
$c1 = array_shift($temp_cw);
|
||||
@@ -834,12 +853,17 @@ class Datamatrix {
|
||||
$cw[] = ($tmp >> 8);
|
||||
$cw[] = ($tmp % 256);
|
||||
$cw_num += 2;
|
||||
$pos = $epos;
|
||||
$enc = ENC_ASCII;
|
||||
$this->last_enc = $enc;
|
||||
} else {
|
||||
// switch to ASCII encoding
|
||||
if ($enc != ENC_ASCII) {
|
||||
$enc = ENC_ASCII;
|
||||
$this->last_enc = $enc;
|
||||
$cw[] = $this->getSwitchEncodingCodeword($enc);
|
||||
++$cw_num;
|
||||
$pos = ($epos - $p);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -862,6 +886,8 @@ class Datamatrix {
|
||||
if (($field_lenght == 4) OR ($epos == $data_lenght) OR !$this->isCharMode($chr, ENC_EDF)) {
|
||||
if (($epos == $data_lenght) AND ($field_lenght < 3)) {
|
||||
$enc = ENC_ASCII;
|
||||
$cw[] = $this->getSwitchEncodingCodeword($enc);
|
||||
++$cw_num;
|
||||
break;
|
||||
}
|
||||
if ($field_lenght < 4) {
|
||||
@@ -873,6 +899,7 @@ class Datamatrix {
|
||||
$temp_cw[] = 0;
|
||||
}
|
||||
$enc = ENC_ASCII;
|
||||
$this->last_enc = $enc;
|
||||
}
|
||||
// encodes four data characters in three codewords
|
||||
$tcw = (($temp_cw[0] & 0x3F) << 2) + (($temp_cw[1] & 0x30) >> 4);
|
||||
@@ -909,8 +936,6 @@ class Datamatrix {
|
||||
if ($newenc != $enc) {
|
||||
// 1. If the look-ahead test (starting at step J) indicates another mode, switch to that mode.
|
||||
$enc = $newenc;
|
||||
$cw[] = $this->getSwitchEncodingCodeword($enc);
|
||||
++$cw_num;
|
||||
break; // exit from B256 mode
|
||||
} else {
|
||||
// 2. Otherwise, process the next character in Base 256 encodation.
|
||||
@@ -922,25 +947,23 @@ class Datamatrix {
|
||||
}
|
||||
// set field lenght
|
||||
if ($field_lenght <= 249) {
|
||||
$cw[] = $field_lenght;
|
||||
$cw[] = $this->get255StateCodeword($field_lenght, ($cw_num + 1));
|
||||
++$cw_num;
|
||||
} else {
|
||||
$cw[] = (floor($field_lenght / 250) + 249);
|
||||
$cw[] = ($field_lenght % 250);
|
||||
$cw[] = $this->get255StateCodeword((floor($field_lenght / 250) + 249), ($cw_num + 1));
|
||||
$cw[] = $this->get255StateCodeword(($field_lenght % 250), ($cw_num + 2));
|
||||
$cw_num += 2;
|
||||
}
|
||||
if (!empty($temp_cw)) {
|
||||
// add B256 field
|
||||
foreach ($temp_cw as $p => $cht) {
|
||||
$cw[] = $this->get255StateCodeword($chr, ($cw_num + $p));
|
||||
$cw[] = $this->get255StateCodeword($cht, ($cw_num + $p + 1));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} // end of switch enc
|
||||
} // end of while
|
||||
// set last used encoding
|
||||
$this->last_enc = $enc;
|
||||
return $cw;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// File name : pdf417.php
|
||||
// Version : 1.0.005
|
||||
// Begin : 2010-06-03
|
||||
// Last Update : 2013-09-17
|
||||
// Last Update : 2014-04-25
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
@@ -934,12 +934,12 @@ class PDF417 {
|
||||
$sublen = strlen($code);
|
||||
}
|
||||
if ($sublen == 6) {
|
||||
$t = bcmul(''.ord($code{0}), '1099511627776');
|
||||
$t = bcadd($t, bcmul(''.ord($code{1}), '4294967296'));
|
||||
$t = bcadd($t, bcmul(''.ord($code{2}), '16777216'));
|
||||
$t = bcadd($t, bcmul(''.ord($code{3}), '65536'));
|
||||
$t = bcadd($t, bcmul(''.ord($code{4}), '256'));
|
||||
$t = bcadd($t, ''.ord($code{5}));
|
||||
$t = bcmul(''.ord($code[0]), '1099511627776');
|
||||
$t = bcadd($t, bcmul(''.ord($code[1]), '4294967296'));
|
||||
$t = bcadd($t, bcmul(''.ord($code[2]), '16777216'));
|
||||
$t = bcadd($t, bcmul(''.ord($code[3]), '65536'));
|
||||
$t = bcadd($t, bcmul(''.ord($code[4]), '256'));
|
||||
$t = bcadd($t, ''.ord($code[5]));
|
||||
// tmp array for the 6 bytes block
|
||||
$cw6 = array();
|
||||
do {
|
||||
|
||||
Binary file not shown.
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf_colors.php
|
||||
// Version : 1.0.003
|
||||
// Version : 1.0.004
|
||||
// Begin : 2002-04-09
|
||||
// Last Update : 2013-10-25
|
||||
// Last Update : 2014-04-25
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
@@ -42,7 +42,7 @@
|
||||
* @class TCPDF_COLORS
|
||||
* PHP color class for TCPDF
|
||||
* @package com.tecnick.tcpdf
|
||||
* @version 1.0.003
|
||||
* @version 1.0.004
|
||||
* @author Nicola Asuni - info@tecnick.com
|
||||
*/
|
||||
class TCPDF_COLORS {
|
||||
@@ -306,7 +306,7 @@ class TCPDF_COLORS {
|
||||
}
|
||||
return $returncolor;
|
||||
}
|
||||
} elseif ((substr($color, 0, 4) != 'cmyk') AND ($dotpos = strpos($color, '.')) !== false) {
|
||||
} elseif ((substr($color, 0, 4) != 'cmyk') AND (substr($color, 0, 3) != 'rgb') AND (($dotpos = strpos($color, '.')) !== false)) {
|
||||
// remove class parent (i.e.: color.red)
|
||||
$color = substr($color, ($dotpos + 1));
|
||||
if ($color == 'transparent') {
|
||||
@@ -351,7 +351,7 @@ class TCPDF_COLORS {
|
||||
}
|
||||
return $returncolor;
|
||||
}
|
||||
if ($color{0} != '#') {
|
||||
if ($color[0] != '#') {
|
||||
// COLOR NAME
|
||||
if (isset(self::$webcolor[$color])) {
|
||||
// web color
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// File name : tcpdf_filters.php
|
||||
// Version : 1.0.001
|
||||
// Begin : 2011-05-23
|
||||
// Last Update : 2013-09-15
|
||||
// Last Update : 2014-04-25
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
@@ -320,12 +320,12 @@ class TCPDF_FILTERS {
|
||||
if ($index < $dix) {
|
||||
// index exist on dictionary
|
||||
$decoded .= $dictionary[$index];
|
||||
$dic_val = $dictionary[$prev_index].$dictionary[$index]{0};
|
||||
$dic_val = $dictionary[$prev_index].$dictionary[$index][0];
|
||||
// store current index
|
||||
$prev_index = $index;
|
||||
} else {
|
||||
// index do not exist on dictionary
|
||||
$dic_val = $dictionary[$prev_index].$dictionary[$prev_index]{0};
|
||||
$dic_val = $dictionary[$prev_index].$dictionary[$prev_index][0];
|
||||
$decoded .= $dic_val;
|
||||
}
|
||||
// update dictionary
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf_fonts.php
|
||||
// Version : 1.0.011
|
||||
// Version : 1.0.013
|
||||
// Begin : 2008-01-01
|
||||
// Last Update : 2014-01-03
|
||||
// Last Update : 2014-05-23
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
@@ -42,7 +42,7 @@
|
||||
* @class TCPDF_FONTS
|
||||
* Font methods for TCPDF library.
|
||||
* @package com.tecnick.tcpdf
|
||||
* @version 1.0.011
|
||||
* @version 1.0.013
|
||||
* @author Nicola Asuni - info@tecnick.com
|
||||
*/
|
||||
class TCPDF_FONTS {
|
||||
@@ -792,6 +792,7 @@ class TCPDF_FONTS {
|
||||
}
|
||||
$fmetric['MissingWidth'] = $cw[0];
|
||||
$fmetric['cw'] = '';
|
||||
$fmetric['cbbox'] = '';
|
||||
for ($cid = 0; $cid <= 65535; ++$cid) {
|
||||
if (isset($ctg[$cid])) {
|
||||
if (isset($cw[$ctg[$cid]])) {
|
||||
@@ -809,7 +810,7 @@ class TCPDF_FONTS {
|
||||
}
|
||||
} // end of true type
|
||||
if (($fmetric['type'] == 'TrueTypeUnicode') AND (count($ctg) == 256)) {
|
||||
$fmetric['type'] == 'TrueType';
|
||||
$fmetric['type'] = 'TrueType';
|
||||
}
|
||||
// ---------- create php font file ----------
|
||||
$pfile = '<'.'?'.'php'."\n";
|
||||
@@ -896,7 +897,7 @@ class TCPDF_FONTS {
|
||||
$pfile .= '\'MaxWidth\'=>'.$fmetric['MaxWidth'].',';
|
||||
$pfile .= '\'MissingWidth\'=>'.$fmetric['MissingWidth'].'';
|
||||
$pfile .= ');'."\n";
|
||||
if (isset($fmetric['cbbox'])) {
|
||||
if (!empty($fmetric['cbbox'])) {
|
||||
$pfile .= '$cbbox=array('.substr($fmetric['cbbox'], 1).');'."\n";
|
||||
}
|
||||
$pfile .= '$cw=array('.substr($fmetric['cw'], 1).');'."\n";
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf_images.php
|
||||
// Version : 1.0.002
|
||||
// Version : 1.0.003
|
||||
// Begin : 2002-08-03
|
||||
// Last Update : 2013-11-24
|
||||
// Last Update : 2014-04-03
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
// Copyright (C) 2002-2013 Nicola Asuni - Tecnick.com LTD
|
||||
// Copyright (C) 2002-2014 Nicola Asuni - Tecnick.com LTD
|
||||
//
|
||||
// This file is part of TCPDF software library.
|
||||
//
|
||||
@@ -38,7 +38,7 @@
|
||||
* This is a PHP class that contains static image methods for the TCPDF class.<br>
|
||||
* @package com.tecnick.tcpdf
|
||||
* @author Nicola Asuni
|
||||
* @version 1.0.002
|
||||
* @version 1.0.003
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,7 @@
|
||||
* Static image methods used by the TCPDF class.
|
||||
* @package com.tecnick.tcpdf
|
||||
* @brief PHP class for generating PDF documents without requiring external extensions.
|
||||
* @version 1.0.002
|
||||
* @version 1.0.003
|
||||
* @author Nicola Asuni - info@tecnick.com
|
||||
*/
|
||||
class TCPDF_IMAGES {
|
||||
@@ -218,7 +218,7 @@ class TCPDF_IMAGES {
|
||||
if (count($icc) > 0) {
|
||||
ksort($icc);
|
||||
$icc = implode('', $icc);
|
||||
if ((ord($icc{36}) != 0x61) OR (ord($icc{37}) != 0x63) OR (ord($icc{38}) != 0x73) OR (ord($icc{39}) != 0x70)) {
|
||||
if ((ord($icc[36]) != 0x61) OR (ord($icc[37]) != 0x63) OR (ord($icc[38]) != 0x73) OR (ord($icc[39]) != 0x70)) {
|
||||
// invalid ICC profile
|
||||
$icc = false;
|
||||
}
|
||||
@@ -299,14 +299,16 @@ class TCPDF_IMAGES {
|
||||
} elseif ($type == 'tRNS') {
|
||||
// read transparency info
|
||||
$t = TCPDF_STATIC::rfread($f, $n);
|
||||
if ($ct == 0) {
|
||||
$trns = array(ord($t{1}));
|
||||
} elseif ($ct == 2) {
|
||||
$trns = array(ord($t{1}), ord($t{3}), ord($t{5}));
|
||||
} else {
|
||||
$pos = strpos($t, chr(0));
|
||||
if ($pos !== false) {
|
||||
$trns = array($pos);
|
||||
if ($ct == 0) { // DeviceGray
|
||||
$trns = array(ord($t[1]));
|
||||
} elseif ($ct == 2) { // DeviceRGB
|
||||
$trns = array(ord($t[1]), ord($t[3]), ord($t[5]));
|
||||
} else { // Indexed
|
||||
if ($n > 0) {
|
||||
$trns = array();
|
||||
for ($i = 0; $i < $n; ++ $i) {
|
||||
$trns[] = ord($t{$i});
|
||||
}
|
||||
}
|
||||
}
|
||||
fread($f, 4);
|
||||
@@ -317,11 +319,9 @@ class TCPDF_IMAGES {
|
||||
} elseif ($type == 'iCCP') {
|
||||
// skip profile name
|
||||
$len = 0;
|
||||
while ((ord(fread($f, 1)) > 0) AND ($len < 80)) {
|
||||
while ((ord(fread($f, 1)) != 0) AND ($len < 80)) {
|
||||
++$len;
|
||||
}
|
||||
// skip null separator
|
||||
fread($f, 1);
|
||||
// get compression method
|
||||
if (ord(fread($f, 1)) != 0) {
|
||||
// Unknown filter method
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf_static.php
|
||||
// Version : 1.0.002
|
||||
// Version : 1.0.004
|
||||
// Begin : 2002-08-03
|
||||
// Last Update : 2013-09-14
|
||||
// Last Update : 2014-09-02
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
// Copyright (C) 2002-2013 Nicola Asuni - Tecnick.com LTD
|
||||
// Copyright (C) 2002-2014 Nicola Asuni - Tecnick.com LTD
|
||||
//
|
||||
// This file is part of TCPDF software library.
|
||||
//
|
||||
@@ -38,7 +38,7 @@
|
||||
* This is a PHP class that contains static methods for the TCPDF class.<br>
|
||||
* @package com.tecnick.tcpdf
|
||||
* @author Nicola Asuni
|
||||
* @version 1.0.002
|
||||
* @version 1.0.004
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,7 @@
|
||||
* Static methods used by the TCPDF class.
|
||||
* @package com.tecnick.tcpdf
|
||||
* @brief PHP class for generating PDF documents without requiring external extensions.
|
||||
* @version 1.0.002
|
||||
* @version 1.0.004
|
||||
* @author Nicola Asuni - info@tecnick.com
|
||||
*/
|
||||
class TCPDF_STATIC {
|
||||
@@ -55,7 +55,7 @@ class TCPDF_STATIC {
|
||||
* Current TCPDF version.
|
||||
* @private static
|
||||
*/
|
||||
private static $tcpdf_version = '6.0.062';
|
||||
private static $tcpdf_version = '6.0.093';
|
||||
|
||||
/**
|
||||
* String alias for total number of pages.
|
||||
@@ -137,7 +137,7 @@ class TCPDF_STATIC {
|
||||
public static function set_mqr($mqr) {
|
||||
if (!defined('PHP_VERSION_ID')) {
|
||||
$version = PHP_VERSION;
|
||||
define('PHP_VERSION_ID', (($version{0} * 10000) + ($version{2} * 100) + $version{4}));
|
||||
define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4]));
|
||||
}
|
||||
if (PHP_VERSION_ID < 50300) {
|
||||
@set_magic_quotes_runtime($mqr);
|
||||
@@ -153,7 +153,7 @@ class TCPDF_STATIC {
|
||||
public static function get_mqr() {
|
||||
if (!defined('PHP_VERSION_ID')) {
|
||||
$version = PHP_VERSION;
|
||||
define('PHP_VERSION_ID', (($version{0} * 10000) + ($version{2} * 100) + $version{4}));
|
||||
define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4]));
|
||||
}
|
||||
if (PHP_VERSION_ID < 50300) {
|
||||
return @get_magic_quotes_runtime();
|
||||
@@ -1098,7 +1098,7 @@ class TCPDF_STATIC {
|
||||
* @public static
|
||||
*/
|
||||
public static function getObjFilename($type='tmp') {
|
||||
return tempnam(K_PATH_CACHE, '__tcpdf_'.$type.'_'.md5(getmypid().uniqid('', true).rand().microtime(true)).'_');
|
||||
return tempnam(K_PATH_CACHE, '__tcpdf_'.$type.'_'.md5(uniqid('', true).rand().microtime(true)).'_');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1358,7 +1358,6 @@ class TCPDF_STATIC {
|
||||
}
|
||||
$seed .= uniqid('', true);
|
||||
$seed .= rand();
|
||||
$seed .= getmypid();
|
||||
$seed .= __FILE__;
|
||||
if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
$seed .= $_SERVER['REMOTE_ADDR'];
|
||||
@@ -1569,7 +1568,7 @@ class TCPDF_STATIC {
|
||||
$length = strlen($name);
|
||||
for ($i = 0; $i < $length; ++$i) {
|
||||
$chr = $name[$i];
|
||||
if (preg_match('/[0-9a-zA-Z]/', $chr) == 1) {
|
||||
if (preg_match('/[0-9a-zA-Z#_=-]/', $chr) == 1) {
|
||||
$escname .= $chr;
|
||||
} else {
|
||||
$escname .= sprintf('#%02X', ord($chr));
|
||||
@@ -2165,7 +2164,7 @@ class TCPDF_STATIC {
|
||||
$attrib = strtolower(trim($attrib[0]));
|
||||
if (!empty($attrib)) {
|
||||
// check if matches class, id, attribute, pseudo-class or pseudo-element
|
||||
switch ($attrib{0}) {
|
||||
switch ($attrib[0]) {
|
||||
case '.': { // class
|
||||
if (in_array(substr($attrib, 1), $class)) {
|
||||
$valid = true;
|
||||
@@ -2232,7 +2231,7 @@ class TCPDF_STATIC {
|
||||
break;
|
||||
}
|
||||
case ':': { // pseudo-class or pseudo-element
|
||||
if ($attrib{1} == ':') { // pseudo-element
|
||||
if ($attrib[1] == ':') { // pseudo-element
|
||||
// pseudo-elements are not supported!
|
||||
// (::first-line, ::first-letter, ::before, ::after)
|
||||
} else { // pseudo-class
|
||||
@@ -2451,13 +2450,23 @@ class TCPDF_STATIC {
|
||||
|
||||
/**
|
||||
* Serialize an array of parameters to be used with TCPDF tag in HTML code.
|
||||
* @param $pararray (array) parameters array
|
||||
* @return sting containing serialized data
|
||||
* @param $data (array) parameters array
|
||||
* @return string containing serialized data
|
||||
* @since 4.9.006 (2010-04-02)
|
||||
* @public static
|
||||
*/
|
||||
public static function serializeTCPDFtagParameters($pararray) {
|
||||
return urlencode(serialize($pararray));
|
||||
public static function serializeTCPDFtagParameters($data) {
|
||||
return urlencode(json_encode($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Unserialize parameters to be used with TCPDF tag in HTML code.
|
||||
* @param $data (string) serialized data
|
||||
* @return array containing unserialized data
|
||||
* @public static
|
||||
*/
|
||||
public static function unserializeTCPDFtagParameters($data) {
|
||||
return json_decode(urldecode($data), true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2764,6 +2773,7 @@ class TCPDF_STATIC {
|
||||
* @public static
|
||||
*/
|
||||
public static function fileGetContents($file) {
|
||||
//$file = html_entity_decode($file);
|
||||
// array of possible alternative paths/URLs
|
||||
$alt = array($file);
|
||||
// replace URL relative path with full real server path
|
||||
@@ -2800,6 +2810,10 @@ class TCPDF_STATIC {
|
||||
$alt[] = $tmp;
|
||||
}
|
||||
}
|
||||
if (isset($_SERVER['SCRIPT_URI'])) {
|
||||
$urldata = @parse_url($_SERVER['SCRIPT_URI']);
|
||||
$alt[] = $urldata['scheme'].'://'.$urldata['host'].(($file[0] == '/') ? '' : '/').$file;
|
||||
}
|
||||
foreach ($alt as $f) {
|
||||
$ret = @file_get_contents($f);
|
||||
if (($ret === FALSE)
|
||||
@@ -2808,7 +2822,7 @@ class TCPDF_STATIC {
|
||||
AND preg_match('%^(https?|ftp)://%', $f)) {
|
||||
// try to get remote file data using cURL
|
||||
$cs = curl_init(); // curl session
|
||||
curl_setopt($cs, CURLOPT_URL, $file);
|
||||
curl_setopt($cs, CURLOPT_URL, $f);
|
||||
curl_setopt($cs, CURLOPT_BINARYTRANSFER, true);
|
||||
curl_setopt($cs, CURLOPT_FAILONERROR, true);
|
||||
curl_setopt($cs, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Description of TCPDF library import 6.0.062
|
||||
Description of TCPDF library import 6.0.093
|
||||
===========================================
|
||||
* delete examples/, tools/ and tcpdf_import.php
|
||||
* remove tcpdf_import.php from composer.json
|
||||
* remove all fonts that were not already present
|
||||
* visit http://127.0.0.1/lib/tests/other/pdflibtestpage.php and view the pdf
|
||||
|
||||
|
||||
+610
-334
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
// File name : tcpdf_autoconfig.php
|
||||
// Version : 1.0.000
|
||||
// Begin : 2013-05-16
|
||||
// Last Update : 2014-01-25
|
||||
// Last Update : 2014-09-02
|
||||
// Authors : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
@@ -232,6 +232,11 @@ if (!defined('K_TCPDF_THROW_EXCEPTION_ERROR')) {
|
||||
define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
|
||||
}
|
||||
|
||||
if (!defined('K_TIMEZONE')) {
|
||||
define('K_TIMEZONE', @date_default_timezone_get());
|
||||
}
|
||||
date_default_timezone_set(K_TIMEZONE);
|
||||
|
||||
//============================================================+
|
||||
// END OF FILE
|
||||
//============================================================+
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf_barcodes_1d.php
|
||||
// Version : 1.0.025
|
||||
// Version : 1.0.026
|
||||
// Begin : 2008-06-09
|
||||
// Last Update : 2013-03-17
|
||||
// Last Update : 2014-05-20
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
// Copyright (C) 2008-2013 Nicola Asuni - Tecnick.com LTD
|
||||
// Copyright (C) 2008-2014 Nicola Asuni - Tecnick.com LTD
|
||||
//
|
||||
// This file is part of TCPDF software library.
|
||||
//
|
||||
@@ -37,14 +37,14 @@
|
||||
* PHP class to creates array representations for common 1D barcodes to be used with TCPDF.
|
||||
* @package com.tecnick.tcpdf
|
||||
* @author Nicola Asuni
|
||||
* @version 1.0.025
|
||||
* @version 1.0.026
|
||||
*/
|
||||
|
||||
/**
|
||||
* @class TCPDFBarcode
|
||||
* PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).<br>
|
||||
* @package com.tecnick.tcpdf
|
||||
* @version 1.0.025
|
||||
* @version 1.0.026
|
||||
* @author Nicola Asuni
|
||||
*/
|
||||
class TCPDFBarcode {
|
||||
@@ -162,6 +162,25 @@ class TCPDFBarcode {
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a PNG image representation of barcode (requires GD or Imagick library).
|
||||
* @param $w (int) Width of a single bar element in pixels.
|
||||
* @param $h (int) Height of a single bar element in pixels.
|
||||
* @param $color (array) RGB (0-255) foreground color for bar elements (background is transparent).
|
||||
* @public
|
||||
*/
|
||||
public function getBarcodePNG($w=2, $h=30, $color=array(0,0,0)) {
|
||||
$data = $this->getBarcodePngData($w, $h, $color);
|
||||
// send headers
|
||||
header('Content-Type: image/png');
|
||||
header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1
|
||||
header('Pragma: public');
|
||||
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
//header('Content-Length: '.strlen($data));
|
||||
echo $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a PNG image representation of barcode (requires GD or Imagick library).
|
||||
* @param $w (int) Width of a single bar element in pixels.
|
||||
@@ -170,7 +189,7 @@ class TCPDFBarcode {
|
||||
* @return image or false in case of error.
|
||||
* @public
|
||||
*/
|
||||
public function getBarcodePNG($w=2, $h=30, $color=array(0,0,0)) {
|
||||
public function getBarcodePngData($w=2, $h=30, $color=array(0,0,0)) {
|
||||
// calculate image size
|
||||
$width = ($this->barcode_array['maxw'] * $w);
|
||||
$height = $h;
|
||||
@@ -208,18 +227,15 @@ class TCPDFBarcode {
|
||||
}
|
||||
$x += $bw;
|
||||
}
|
||||
// send headers
|
||||
header('Content-Type: image/png');
|
||||
header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1
|
||||
header('Pragma: public');
|
||||
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
if ($imagick) {
|
||||
$png->drawimage($bar);
|
||||
echo $png;
|
||||
return $png;
|
||||
} else {
|
||||
ob_start();
|
||||
imagepng($png);
|
||||
$imagedata = ob_get_clean();
|
||||
imagedestroy($png);
|
||||
return $imagedata;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1094,7 +1110,7 @@ class TCPDFBarcode {
|
||||
}
|
||||
case 'C': { // MODE C
|
||||
$startid = 105;
|
||||
if (ord($code{0}) == 241) {
|
||||
if (ord($code[0]) == 241) {
|
||||
$code_data[] = 102;
|
||||
$code = substr($code, 1);
|
||||
--$len;
|
||||
@@ -1172,7 +1188,7 @@ class TCPDFBarcode {
|
||||
}
|
||||
case 'B': {
|
||||
if ($key == 0) {
|
||||
$tmpchr = ord($seq[1]{0});
|
||||
$tmpchr = ord($seq[1][0]);
|
||||
if (($seq[2] == 1) AND ($tmpchr >= 241) AND ($tmpchr <= 244) AND isset($sequence[($key + 1)]) AND ($sequence[($key + 1)][0] != 'B')) {
|
||||
switch ($sequence[($key + 1)][0]) {
|
||||
case 'A': {
|
||||
@@ -1445,7 +1461,7 @@ class TCPDFBarcode {
|
||||
$seq = '101'; // left guard bar
|
||||
if ($upce) {
|
||||
$bararray = array('code' => $upce_code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
||||
$p = $upce_parities[$code{1}][$r];
|
||||
$p = $upce_parities[$code[1]][$r];
|
||||
for ($i = 0; $i < 6; ++$i) {
|
||||
$seq .= $codes[$p[$i]][$upce_code{$i}];
|
||||
}
|
||||
@@ -1458,7 +1474,7 @@ class TCPDFBarcode {
|
||||
$seq .= $codes['A'][$code{$i}];
|
||||
}
|
||||
} else {
|
||||
$p = $parities[$code{0}];
|
||||
$p = $parities[$code[0]];
|
||||
for ($i = 1; $i < $half_len; ++$i) {
|
||||
$seq .= $codes[$p[$i-1]][$code{$i}];
|
||||
}
|
||||
@@ -1504,7 +1520,7 @@ class TCPDFBarcode {
|
||||
if ($len == 2) {
|
||||
$r = $code % 4;
|
||||
} elseif ($len == 5) {
|
||||
$r = (3 * ($code{0} + $code{2} + $code{4})) + (9 * ($code{1} + $code{3}));
|
||||
$r = (3 * ($code[0] + $code[2] + $code[4])) + (9 * ($code[1] + $code[3]));
|
||||
$r %= 10;
|
||||
} else {
|
||||
return false;
|
||||
@@ -1555,7 +1571,7 @@ class TCPDFBarcode {
|
||||
);
|
||||
$p = $parities[$len][$r];
|
||||
$seq = '1011'; // left guard bar
|
||||
$seq .= $codes[$p[0]][$code{0}];
|
||||
$seq .= $codes[$p[0]][$code[0]];
|
||||
for ($i = 1; $i < $len; ++$i) {
|
||||
$seq .= '01'; // separator
|
||||
$seq .= $codes[$p[$i]][$code{$i}];
|
||||
@@ -2068,9 +2084,9 @@ class TCPDFBarcode {
|
||||
}
|
||||
}
|
||||
$binary_code = bcmul($binary_code, 10);
|
||||
$binary_code = bcadd($binary_code, $tracking_number{0});
|
||||
$binary_code = bcadd($binary_code, $tracking_number[0]);
|
||||
$binary_code = bcmul($binary_code, 5);
|
||||
$binary_code = bcadd($binary_code, $tracking_number{1});
|
||||
$binary_code = bcadd($binary_code, $tracking_number[1]);
|
||||
$binary_code .= substr($tracking_number, 2, 18);
|
||||
// convert to hexadecimal
|
||||
$binary_code = $this->dec_to_hex($binary_code);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf_barcodes_2d.php
|
||||
// Version : 1.0.014
|
||||
// Version : 1.0.015
|
||||
// Begin : 2009-04-07
|
||||
// Last Update : 2013-03-17
|
||||
// Last Update : 2014-05-20
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||
// Copyright (C) 2009-2014 Nicola Asuni - Tecnick.com LTD
|
||||
//
|
||||
// This file is part of TCPDF software library.
|
||||
//
|
||||
@@ -37,14 +37,14 @@
|
||||
* PHP class to creates array representations for 2D barcodes to be used with TCPDF.
|
||||
* @package com.tecnick.tcpdf
|
||||
* @author Nicola Asuni
|
||||
* @version 1.0.014
|
||||
* @version 1.0.015
|
||||
*/
|
||||
|
||||
/**
|
||||
* @class TCPDF2DBarcode
|
||||
* PHP class to creates array representations for 2D barcodes to be used with TCPDF (http://www.tcpdf.org).
|
||||
* @package com.tecnick.tcpdf
|
||||
* @version 1.0.014
|
||||
* @version 1.0.015
|
||||
* @author Nicola Asuni
|
||||
*/
|
||||
class TCPDF2DBarcode {
|
||||
@@ -162,6 +162,26 @@ class TCPDF2DBarcode {
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a PNG image representation of barcode (requires GD or Imagick library).
|
||||
* @param $w (int) Width of a single rectangle element in pixels.
|
||||
* @param $h (int) Height of a single rectangle element in pixels.
|
||||
* @param $color (array) RGB (0-255) foreground color for bar elements (background is transparent).
|
||||
* @public
|
||||
*/
|
||||
public function getBarcodePNG($w=3, $h=3, $color=array(0,0,0)) {
|
||||
$data = $this->getBarcodePngData($w, $h, $color);
|
||||
// send headers
|
||||
header('Content-Type: image/png');
|
||||
header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1
|
||||
header('Pragma: public');
|
||||
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
//header('Content-Length: '.strlen($data));
|
||||
echo $data;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a PNG image representation of barcode (requires GD or Imagick library).
|
||||
* @param $w (int) Width of a single rectangle element in pixels.
|
||||
@@ -170,7 +190,7 @@ class TCPDF2DBarcode {
|
||||
* @return image or false in case of error.
|
||||
* @public
|
||||
*/
|
||||
public function getBarcodePNG($w=3, $h=3, $color=array(0,0,0)) {
|
||||
public function getBarcodePngData($w=3, $h=3, $color=array(0,0,0)) {
|
||||
// calculate image size
|
||||
$width = ($this->barcode_array['num_cols'] * $w);
|
||||
$height = ($this->barcode_array['num_rows'] * $h);
|
||||
@@ -211,18 +231,15 @@ class TCPDF2DBarcode {
|
||||
}
|
||||
$y += $h;
|
||||
}
|
||||
// send headers
|
||||
header('Content-Type: image/png');
|
||||
header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1
|
||||
header('Pragma: public');
|
||||
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
if ($imagick) {
|
||||
$png->drawimage($bar);
|
||||
echo $png;
|
||||
return $png;
|
||||
} else {
|
||||
ob_start();
|
||||
imagepng($png);
|
||||
$imagedata = ob_get_clean();
|
||||
imagedestroy($png);
|
||||
return $imagedata;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
<location>tcpdf</location>
|
||||
<name>TCPDF</name>
|
||||
<license>LGPL</license>
|
||||
<version>6.0.062</version>
|
||||
<version>6.0.093</version>
|
||||
<licenseversion>3</licenseversion>
|
||||
</library>
|
||||
<library>
|
||||
|
||||
Reference in New Issue
Block a user