MDL-35188 import tcpdf 5.9.181

This commit is contained in:
Petr Škoda
2012-09-02 15:58:25 +02:00
parent 569f1ad63b
commit d6ed2191d7
11 changed files with 747 additions and 215 deletions
+6 -6
View File
@@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : 2dbarcodes.php
// Version : 1.0.013
// Version : 1.0.014
// Begin : 2009-04-07
// Last Update : 2012-01-12
// Last Update : 2012-04-30
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - [email protected]
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@@ -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.013
* @version 1.0.014
*/
/**
* @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.013
* @version 1.0.014
* @author Nicola Asuni
*/
class TCPDF2DBarcode {
@@ -202,9 +202,9 @@ class TCPDF2DBarcode {
if ($this->barcode_array['bcode'][$r][$c] == 1) {
// draw a single barcode cell
if ($imagick) {
$bar->rectangle($x, $y, ($x + $w), ($y + $h));
$bar->rectangle($x, $y, ($x + $w - 1), ($y + $h - 1));
} else {
imagefilledrectangle($png, $x, $y, ($x + $w), ($y + $h), $fgcol);
imagefilledrectangle($png, $x, $y, ($x + $w - 1), ($y + $h - 1), $fgcol);
}
}
$x += $w;
+96 -1
View File
@@ -1,3 +1,98 @@
5.9.181 (2012-08-31)
- composer.json file was added.
- Bug item #3563369 "Cached images are not unlinked some time" was fixed.
5.9.180 (2012-08-22)
- Bug item #3560493 "Problems with nested cells in HTML" was fixed.
5.9.179 (2012-08-04)
- SVG 'use' tag was fixed for 'circle' and 'ellipse' shift problem.
- Alpha status is now correctly stored and restored by getGraphicVars() and SetGraphicVars() methods.
5.9.178 (2012-08-02)
- SVG 'use' tag was fixed for 'circle' and 'ellipse'.
5.9.177 (2012-08-02)
- An additional control on annotations was fixed.
5.9.176 (2012-07-25)
- A bug related to stroke width was fixed.
- A problem related to font spacing in HTML was fixed.
5.9.175 (2012-07-25)
- The problem of missing letter on hyphen break was fixed.
5.9.174 (2012-07-25)
- The problem of wrong filename when downloading PDF from an Android device was fixed.
- The method setHeaderData() was extended to set text and line color for header (see example n. 1).
- The method setFooterData() was added to set text and line color for footer (see example n. 1).
- The methods setTextShadow() and getTextShadow() were added to set text shadows (see example n. 1).
- The GetCharWidth() method was fixed for negative character spacing.
- A 'none' border mode is now correctly recognized.
- Break on hyphen problem was fixed.
5.9.173 (2012-07-23)
- Some additional control wher added on barcode methods.
- The option CURLOPT_FOLLOWLOCATION on Image method is now disabled if PHP safe_mode is on or open_basedir is set.
- Method Bookmark() was extended to include X parameter.
- Method setDestination() was extended to include X parameter.
- A problem with Thai language was fixed.
5.9.172 (2012-07-02)
- A PNG color profile issue was fixed.
5.9.171 (2012-07-01)
- Some SVG rendering problems were fixed.
5.9.170 (2012-06-27)
- Bug #3538227 "Numerous errors inserting shared images" was fixed.
5.9.169 (2012-06-25)
- Some SVG rendering problems were fixed.
5.9.168 (2012-06-22)
- Thai language rendering was fixed.
5.9.167 (2012-06-22)
- Thai language rendering was fixed and improved.
- Method isCharDefined() was improved.
- Protected method replaceChar() was added.
- Font "kerning" word was corrected to "tracking".
5.9.166 (2012-06-21)
- Array to string conversion on file_id creation was fixed.
- Thai language rendering was fixed (thanks to Atsawin Chaowanakritsanakul).
5.9.165 (2012-06-07)
- Some HTML form related bugs were fixed.
5.9.164 (2012-06-06)
- A bug introduced on the latest release was fixed.
5.9.163 (2012-06-05)
- Method getGDgamma() was changed.
- Rendering performances of PNG images with alpha channel were improved.
5.9.162 (2012-05-11)
- A bug related to long text on TD cells was fixed.
5.9.161 (2012-05-09)
- A bug on XREF table was fixed (Bug ID: 3525051).
- Deprecated Imagick:clone was replaced.
- Method objclone() was fixed for PHP4.
5.9.160 (2012-05-03)
- A bug on tcpdf_parser.php was fixed.
5.9.159 (2012-04-30)
- Barcode classes were updated to fix PNG export Bug (ID: 3522291).
5.9.158 (2012-04-22)
- Some SVG-related bugs were fixed.
5.9.157 (2012-04-16)
- Some SVG-related bugs were fixed.
5.9.156 (2012-04-10)
- Bug item #3515885 "TOC and booklet: left and right page exchanged".
- SetAutoPageBreak(false) now works also in multicolumn mode.
@@ -567,7 +662,7 @@
- The problem of blank page for nobr table higher than a single page was fixed.
5.9.000 (2010-10-06)
- Support for text stretching and spacing (kerning) was added, see example n. 63 and methods setFontStretching(), getFontStretching(), setFontSpacing(), getFontSpacing().
- Support for text stretching and spacing (tracking) was added, see example n. 63 and methods setFontStretching(), getFontStretching(), setFontSpacing(), getFontSpacing().
- Support for CSS properties 'font-stretch' and 'letter-spacing' was added (see example n. 63).
- The cMargin state was replaced by cell_padding array that can be set/get using setCellPadding() and getCellPadding() methods.
- Methods getCellPaddings() and setCellPaddings() were added to fine tune cell paddings (see example n. 5).
+3 -3
View File
@@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 5.9.156
Release date: 2012-04-10
Version: 5.9.181
Release date: 2012-08-31
Author: Nicola Asuni
Copyright (c) 2002-2012:
@@ -47,7 +47,7 @@ Main Features:
* no-write page regions;
* bookmarks, named destinations and table of content;
* text hyphenation;
* text stretching and spacing (tracking/kerning);
* text stretching and spacing (tracking);
* automatic page break, line break and text alignments including justification;
* automatic page numbering and page groups;
* move and delete pages;
+6 -6
View File
@@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : barcodes.php
// Version : 1.0.023
// Version : 1.0.024
// Begin : 2008-06-09
// Last Update : 2012-01-14
// Last Update : 2012-04-30
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - [email protected]
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@@ -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.023
* @version 1.0.024
*/
/**
* @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.023
* @version 1.0.024
* @author Nicola Asuni
*/
class TCPDFBarcode {
@@ -201,9 +201,9 @@ class TCPDFBarcode {
$y = round(($v['p'] * $h / $this->barcode_array['maxh']), 3);
// draw a vertical bar
if ($imagick) {
$bar->rectangle($x, $y, ($x + $bw), ($y + $bh));
$bar->rectangle($x, $y, ($x + $bw - 1), ($y + $bh - 1));
} else {
imagefilledrectangle($png, $x, $y, ($x + $bw), ($y + $bh), $fgcol);
imagefilledrectangle($png, $x, $y, ($x + $bw - 1), ($y + $bh - 1), $fgcol);
}
}
$x += $bw;
+38
View File
@@ -0,0 +1,38 @@
{
"name": "tcpdf/tcpdf",
"version": "5.9.181",
"homepage": "http://www.tcpdf.org/",
"type": "library",
"description": "TCPDF is a PHP class for generating PDF files on-the-fly without requiring external extensions.",
"keywords": ["pdf"],
"license": "LGPLv3",
"authors": [
{
"name": "Nicola Asuni",
"email": "[email protected]",
"homepage": "http://nicolaasuni.tecnick.com"
}
],
"require": {
"php": ">5.2"
},
"autoload": {
"classmap": [
"fonts",
"config/lang",
"config",
"2dbarcodes.php",
"barcodes.php",
"datamatrix.php",
"encodings_maps.php",
"htmlcolors.php",
"pdf417.php",
"qrcode.php",
"spotcolors.php",
"tcpdf.php",
"tcpdf_filters.php",
"tcpdf_parser.php",
"unicode_data.php"
]
}
}
View File
+11 -11
View File
@@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : qrcode.php
// Version : 1.0.009
// Version : 1.0.010
// Begin : 2010-03-22
// Last Update : 2010-12-16
// Last Update : 2012-07-25
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - [email protected]
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@@ -76,7 +76,7 @@
*
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @version 1.0.010
*/
// definitions
@@ -286,7 +286,7 @@ if (!function_exists('str_split')) {
*
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @version 1.0.010
*/
class QRcode {
@@ -1439,12 +1439,10 @@ class QRcode {
/**
* splitString
* @return (int)
*/
protected function splitString() {
while (strlen($this->dataStr) > 0) {
if ($this->dataStr == '') {
return 0;
}
$mode = $this->identifyMode(0);
switch ($mode) {
case QR_MODE_NM: {
@@ -1476,6 +1474,7 @@ class QRcode {
}
$this->dataStr = substr($this->dataStr, $length);
}
return 0;
}
/**
@@ -2028,7 +2027,7 @@ class QRcode {
if ($ver > $this->version) {
$this->version = $ver;
}
for (;;) {
while (true) {
$cbs = $this->createBitStream($items);
$items = $cbs[0];
$bits = $cbs[1];
@@ -2315,17 +2314,18 @@ class QRcode {
/**
* Return a version number that satisfies the input code length.
* @param $size (int) input code length (byte)
* @param $size (int) input code length (bytes)
* @param $level (int) error correction level
* @return int version number
*/
protected function getMinimumVersion($size, $level) {
for ($i=1; $i <= QRSPEC_VERSION_MAX; ++$i) {
$words = $this->capacity[$i][QRCAP_WORDS] - $this->capacity[$i][QRCAP_EC][$level];
for ($i = 1; $i <= QRSPEC_VERSION_MAX; ++$i) {
$words = ($this->capacity[$i][QRCAP_WORDS] - $this->capacity[$i][QRCAP_EC][$level]);
if ($words >= $size) {
return $i;
}
}
// the size of input data is greater than QR capacity, try to lover the error correction mode
return -1;
}
+2 -2
View File
@@ -1,5 +1,5 @@
Description of TCPDF library import 5.9.156
===================================
Description of TCPDF library import 5.9.181
===========================================
* delete cache/ doc/ examples/ config/tcpdf_config_alt.php config/lang/ images/
* remove all fonts but the core ones (courier.php, helveticabi.php,
helveticab.php, helveticai.php, helvetica.php, symbol.php, timesbi.php,
+562 -172
View File
File diff suppressed because it is too large Load Diff
+22 -13
View File
@@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf_parser.php
// Version : 1.0.000
// Version : 1.0.001
// Begin : 2011-05-23
// Last Update : 2012-01-28
// Last Update : 2012-05-03
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - [email protected]
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3
// -------------------------------------------------------------------
@@ -37,7 +37,7 @@
* This is a PHP class for parsing PDF documents.<br>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.000
* @version 1.0.001
*/
// include class for decoding filters
@@ -48,7 +48,7 @@ require_once(dirname(__FILE__).'/tcpdf_filters.php');
* This is a PHP class for parsing PDF documents.<br>
* @package com.tecnick.tcpdf
* @brief This is a PHP class for parsing PDF documents..
* @version 1.0.000
* @version 1.0.001
* @author Nicola Asuni - [email protected]
*/
class TCPDF_PARSER {
@@ -127,20 +127,29 @@ class TCPDF_PARSER {
* @since 1.0.000 (2011-05-24)
*/
protected function getXrefData($offset=0, $xref=array()) {
// find last startxref
if (preg_match_all('/[\r\n]startxref[\s]*[\r\n]+([0-9]+)[\s]*[\r\n]+%%EOF/i', $this->pdfdata, $matches, PREG_SET_ORDER, $offset) == 0) {
$this->Error('Unable to find startxref');
if ($offset == 0) {
// find last startxref
if (preg_match_all('/[\r\n]startxref[\s]*[\r\n]+([0-9]+)[\s]*[\r\n]+%%EOF/i', $this->pdfdata, $matches, PREG_SET_ORDER, $offset) == 0) {
$this->Error('Unable to find startxref');
}
$matches = array_pop($matches);
$startxref = $matches[1];
} else {
// get the first xref at the specified offset
if (preg_match('/[\r\n]startxref[\s]*[\r\n]+([0-9]+)[\s]*[\r\n]+%%EOF/i', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset) == 0) {
$this->Error('Unable to find startxref');
}
$startxref = $matches[1][0];
}
$matches = array_pop($matches);
$startxref = $matches[1];
// check xref position
if (strpos($this->pdfdata, 'xref', $startxref) != $startxref) {
$this->Error('Unable to find xref');
}
// extract xref data (object indexes and offsets)
$offset = $startxref + 5;
$xoffset = $startxref + 5;
// initialize object number
$obj_num = 0;
$offset = $xoffset;
while (preg_match('/^([0-9]+)[\s]([0-9]+)[\s]?([nf]?)/im', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) {
$offset = (strlen($matches[0][0]) + $matches[0][1]);
if ($matches[3][0] == 'n') {
@@ -162,7 +171,7 @@ class TCPDF_PARSER {
}
}
// get trailer data
if (preg_match('/trailer[\s]*<<(.*)>>[\s]*[\r\n]+startxref[\s]*[\r\n]+/isU', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) {
if (preg_match('/trailer[\s]*<<(.*)>>[\s]*[\r\n]+startxref[\s]*[\r\n]+/isU', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $xoffset) > 0) {
$trailer_data = $matches[1][0];
if (!isset($xref['trailer'])) {
// get only the last updated version
@@ -188,7 +197,7 @@ class TCPDF_PARSER {
}
if (preg_match('/Prev[\s]+([0-9]+)/i', $trailer_data, $matches) > 0) {
// get previous xref
$xref = getXrefData(substr($this->pdfdata, 0, $startxref), intval($matches[1]), $xref);
$xref = $this->getXrefData(intval($matches[1]), $xref);
}
} else {
$this->Error('Unable to find trailer');
@@ -399,7 +408,7 @@ class TCPDF_PARSER {
$offset = $element[2];
// decode stream using stream's dictionary information
if ($decoding AND ($element[0] == 'stream') AND (isset($objdata[($i - 1)][0])) AND ($objdata[($i - 1)][0] == '<<')) {
$element[3] = $this->decodeStream($objdata[($i - 1)][1], $element[1]);
$element[3] = $this->decodeStream($objdata[($i - 1)][1], substr($element[1], 1));
}
$objdata[$i] = $element;
++$i;
+1 -1
View File
@@ -179,7 +179,7 @@
<location>tcpdf</location>
<name>TCPDF</name>
<license>LGPL</license>
<version>5.9.156</version>
<version>5.9.181</version>
<licenseversion>3</licenseversion>
</library>
<library>