Update TCPF

Added japanese font files.
This commit is contained in:
Laurent Destailleur 2012-12-10 01:47:39 +01:00
parent ab5998d32f
commit 8e764e88e6
16 changed files with 649 additions and 199 deletions

View File

@ -1,3 +1,70 @@
5.9.200 (2012-12-05)
- Bug item #768 "Rowspan with Pagebreak error" was fixed.
- Page regions now works also with limited MultiCell() cells.
5.9.199 (2012-11-29)
- Internal setImageBuffer() method was improved.
5.9.198 (2012-11-19)
- Datamatrix EDIFACT mode was fixed.
5.9.197 (2012-11-06)
- Bug item #756 "TCPDF 5.9.196 shows line on top of all PDFs" was fixed.
5.9.196 (2012-11-02)
- Several methods were improved to avoid output when the context is out of page.
- Bug item #755 "remove cached files before unsetting" was fixed.
5.9.195 (2012-10-24)
- Method _putfonts() was improved.
5.9.194 (2012-10-23)
- Text alignment on TextField() method was fixed.
5.9.193 (2012-09-25)
- Support for named destinations on HTML links was added (i.e.: <a href="#destinationname">link to named destination</a>).
5.9.192 (2012-09-24)
- A problem on the releasing process was fixed.
5.9.191 (2012-09-24)
- SVG image naow support svg and eps images.
5.9.190 (2012-09-23)
- "page" word translation is now set to empty if not defined.
- Tooltip feature was added on the radiobutton annotation.
5.9.189 (2012-09-18)
- Bug item #3568969 "ini_get safe_mode error" was fixed.
5.9.188 (2012-09-15)
- A datamatrix barcode bug was fixed.
5.9.187 (2012-09-14)
- Subset feature was extended to include the first 256 characters.
5.9.186 (2012-09-13)
- barcodes.php file was resynced.
- Methods SetAbsX, SetAbsY, SetAbsXY where added to set the absolute pointer coordinates.
- Method getCharBBox were added to get single character bounding box.
- Signature of addTTFfont method was changed ($addcbbox paramter was added).
5.9.185 (2012-09-12)
- Method _putfontwidths() was fixed.
5.9.184 (2012-09-11)
- A problem with EAN barcodes was fixed.
5.9.183 (2012-09-07)
- A problem with font names normalization was fixed.
5.9.182 (2012-09-05)
- Bug item #3564982 "Infinite loop in Write() method" was fixed.
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) 5.9.180 (2012-08-22)
- Bug item #3560493 "Problems with nested cells in HTML" was fixed. - Bug item #3560493 "Problems with nested cells in HTML" was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 5.9.180 Version: 5.9.200
Release date: 2012-08-22 Release date: 2012-12-05
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2012: Copyright (c) 2002-2012:

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : barcodes.php // File name : barcodes.php
// Version : 1.0.024 // Version : 1.0.025
// Begin : 2008-06-09 // Begin : 2008-06-09
// Last Update : 2012-04-30 // Last Update : 2012-09-11
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) // 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. * PHP class to creates array representations for common 1D barcodes to be used with TCPDF.
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @author Nicola Asuni * @author Nicola Asuni
* @version 1.0.024 * @version 1.0.025
*/ */
/** /**
* @class TCPDFBarcode * @class TCPDFBarcode
* PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).<br> * PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).<br>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @version 1.0.024 * @version 1.0.025
* @author Nicola Asuni * @author Nicola Asuni
*/ */
class TCPDFBarcode { class TCPDFBarcode {
@ -1452,7 +1452,7 @@ class TCPDFBarcode {
$seq .= '010101'; // right guard bar $seq .= '010101'; // right guard bar
} else { } else {
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
$half_len = ceil($len / 2); $half_len = intval(ceil($len / 2));
if ($len == 8) { if ($len == 8) {
for ($i = 0; $i < $half_len; ++$i) { for ($i = 0; $i < $half_len; ++$i) {
$seq .= $codes['A'][$code{$i}]; $seq .= $codes['A'][$code{$i}];

View File

@ -0,0 +1,38 @@
{
"name": "tecnick.com/tcpdf",
"version": "5.9.200",
"homepage": "http://www.tcpdf.org/",
"type": "library",
"description": "TCPDF is a PHP class for generating PDF documents.",
"keywords": ["pdf","tcpdf","PDFD32000-2008","qrcode","datamatrix","pdf417","barcodes"],
"license": "LGPLv3",
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"homepage": "http://nicolaasuni.tecnick.com"
}
],
"require": {
"php": ">=5.3.0"
},
"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

@ -223,7 +223,7 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
define('HEAD_MAGNIFICATION', 1.1); define('HEAD_MAGNIFICATION', 1.1);
/** /**
* height of cell repect font height * height of cell respect font height
*/ */
define('K_CELL_HEIGHT_RATIO', 1.25); define('K_CELL_HEIGHT_RATIO', 1.25);

View File

@ -214,7 +214,7 @@ define ('PDF_IMAGE_SCALE_RATIO', 1.25);
define('HEAD_MAGNIFICATION', 1.1); define('HEAD_MAGNIFICATION', 1.1);
/** /**
* height of cell repect font height * height of cell respect font height
*/ */
define('K_CELL_HEIGHT_RATIO', 1.25); define('K_CELL_HEIGHT_RATIO', 1.25);

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : datamatrix.php // File name : datamatrix.php
// Version : 1.0.001 // Version : 1.0.004
// Begin : 2010-06-07 // Begin : 2010-06-07
// Last Update : 2011-09-14 // Last Update : 2012-11-19
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -34,14 +34,14 @@
//============================================================+ //============================================================+
/** /**
* @file * @file
* Class to create DataMatrix ECC 200 barcode arrays for TCPDF class. * Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
* DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code. * DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
* *
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @author Nicola Asuni * @author Nicola Asuni
* @version 1.0.001 * @version 1.0.004
*/ */
// custom definitions // custom definitions
if (!defined('DATAMATRIXDEFS')) { if (!defined('DATAMATRIXDEFS')) {
@ -59,54 +59,54 @@ if (!defined('DATAMATRIXDEFS')) {
/** /**
* ASCII encoding: ASCII character 0 to 127 (1 byte per CW) * ASCII encoding: ASCII character 0 to 127 (1 byte per CW)
*/ */
define('ENC_ASCII', 0); define('ENC_ASCII', 0);
/** /**
* C40 encoding: Upper-case alphanumeric (3/2 bytes per CW) * C40 encoding: Upper-case alphanumeric (3/2 bytes per CW)
*/ */
define('ENC_C40', 1); define('ENC_C40', 1);
/** /**
* TEXT encoding: Lower-case alphanumeric (3/2 bytes per CW) * TEXT encoding: Lower-case alphanumeric (3/2 bytes per CW)
*/ */
define('ENC_TXT', 2); define('ENC_TXT', 2);
/** /**
* X12 encoding: ANSI X12 (3/2 byte per CW) * X12 encoding: ANSI X12 (3/2 byte per CW)
*/ */
define('ENC_X12', 3); define('ENC_X12', 3);
/** /**
* EDIFACT encoding: ASCII character 32 to 94 (4/3 bytes per CW) * EDIFACT encoding: ASCII character 32 to 94 (4/3 bytes per CW)
*/ */
define('ENC_EDF', 4); define('ENC_EDF', 4);
/** /**
* BASE 256 encoding: ASCII character 0 to 255 (1 byte per CW) * BASE 256 encoding: ASCII character 0 to 255 (1 byte per CW)
*/ */
define('ENC_BASE256', 5); define('ENC_BASE256', 5);
/** /**
* ASCII extended encoding: ASCII character 128 to 255 (1/2 byte per CW) * ASCII extended encoding: ASCII character 128 to 255 (1/2 byte per CW)
*/ */
define('ENC_ASCII_EXT', 6); define('ENC_ASCII_EXT', 6);
/** /**
* ASCII number encoding: ASCII digits (2 bytes per CW) * ASCII number encoding: ASCII digits (2 bytes per CW)
*/ */
define('ENC_ASCII_NUM', 7); define('ENC_ASCII_NUM', 7);
/** /**
* @class Datamatrix * @class Datamatrix
* Class to create DataMatrix ECC 200 barcode arrays for TCPDF class. * Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
* DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code. * DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
* *
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @author Nicola Asuni * @author Nicola Asuni
* @version 1.0.001 * @version 1.0.004
*/ */
class Datamatrix { class Datamatrix {
/** /**
@ -184,7 +184,7 @@ class Datamatrix {
protected $chset_id = array(ENC_C40 => 'C40', ENC_TXT => 'TXT', ENC_X12 =>'X12'); protected $chset_id = array(ENC_C40 => 'C40', ENC_TXT => 'TXT', ENC_X12 =>'X12');
/** /**
* Basic set of charactes for each encodation mode. * Basic set of characters for each encodation mode.
* @protected * @protected
*/ */
protected $chset = array( protected $chset = array(
@ -270,7 +270,7 @@ class Datamatrix {
$cw[] = 129; $cw[] = 129;
++$nd; ++$nd;
// add remaining pads // add remaining pads
for ($i = $nd; $i <= $params[11]; ++$i) { for ($i = $nd; $i < $params[11]; ++$i) {
$cw[] = $this->get253StateCodeword(129, $i); $cw[] = $this->get253StateCodeword(129, $i);
} }
} }
@ -280,7 +280,7 @@ class Datamatrix {
// initialize empty arrays // initialize empty arrays
$grid = array_fill(0, ($params[2] * $params[3]), 0); $grid = array_fill(0, ($params[2] * $params[3]), 0);
// get placement map // get placement map
$places = $this->getPlacemetMap($params[2], $params[3]); $places = $this->getPlacementMap($params[2], $params[3]);
// fill the grid with data // fill the grid with data
$grid = array(); $grid = array();
$i = 0; $i = 0;
@ -365,7 +365,7 @@ class Datamatrix {
if (($a == 0) OR ($b == 0)) { if (($a == 0) OR ($b == 0)) {
return 0; return 0;
} }
return $alog[($log[$a] + $log[$b]) % ($gf - 1)]; return ($alog[($log[$a] + $log[$b]) % ($gf - 1)]);
} }
/** /**
@ -552,7 +552,7 @@ class Datamatrix {
return ENC_C40; return ENC_C40;
} }
// get char // get char
$chr = ord($data{($pos + $charscount)}); $chr = ord($data[$pos + $charscount]);
$charscount++; $charscount++;
// STEP L // STEP L
if ($this->isCharMode($chr, ENC_ASCII_NUM)) { if ($this->isCharMode($chr, ENC_ASCII_NUM)) {
@ -709,7 +709,7 @@ class Datamatrix {
while ($pos < $data_lenght) { while ($pos < $data_lenght) {
switch ($enc) { switch ($enc) {
case ENC_ASCII: { // STEP B. While in ASCII encodation 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))) { 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))) {
// 1. If the next data sequence is at least 2 consecutive digits, encode the next two digits as a double digit in ASCII mode. // 1. If the next data sequence is at least 2 consecutive digits, encode the next two digits as a double digit in ASCII mode.
$cw[] = (intval(substr($data, $pos, 2)) + 130); $cw[] = (intval(substr($data, $pos, 2)) + 130);
++$cw_num; ++$cw_num;
@ -724,7 +724,7 @@ class Datamatrix {
++$cw_num; ++$cw_num;
} else { } else {
// get new byte // get new byte
$chr = ord($data{($pos)}); $chr = ord($data[$pos]);
++$pos; ++$pos;
if ($this->isCharMode($chr, ENC_ASCII_EXT)) { if ($this->isCharMode($chr, ENC_ASCII_EXT)) {
// 3. If the next data character is extended ASCII (greater than 127) encode it in ASCII mode first using the Upper Shift (value 235) character. // 3. If the next data character is extended ASCII (greater than 127) encode it in ASCII mode first using the Upper Shift (value 235) character.
@ -752,7 +752,7 @@ class Datamatrix {
$charset = $this->chset[$set_id]; $charset = $this->chset[$set_id];
do { do {
// 2. process the next character in C40 encodation. // 2. process the next character in C40 encodation.
$chr = ord($data{($epos)}); $chr = ord($data[$epos]);
++$epos; ++$epos;
// check for extended character // check for extended character
if ($chr & 0x80) { if ($chr & 0x80) {
@ -802,6 +802,8 @@ class Datamatrix {
$enc = $newenc; $enc = $newenc;
$cw[] = $this->getSwitchEncodingCodeword($enc); $cw[] = $this->getSwitchEncodingCodeword($enc);
++$cw_num; ++$cw_num;
$pos -= $p;
$p = 0;
break; break;
} }
} }
@ -834,9 +836,11 @@ class Datamatrix {
$cw_num += 2; $cw_num += 2;
} else { } else {
// switch to ASCII encoding // switch to ASCII encoding
$enc = ENC_ASCII; if ($enc != ENC_ASCII) {
$cw[] = $this->getSwitchEncodingCodeword($enc); $enc = ENC_ASCII;
++$cw_num; $cw[] = $this->getSwitchEncodingCodeword($enc);
++$cw_num;
}
} }
} }
break; break;
@ -846,52 +850,50 @@ class Datamatrix {
$temp_cw = array(); $temp_cw = array();
$epos = $pos; $epos = $pos;
$field_lenght = 0; $field_lenght = 0;
while ($epos < $data_lenght) { $newenc = $enc;
do {
// 2. process the next character in EDIFACT encodation. // 2. process the next character in EDIFACT encodation.
$chr = ord($data{($epos)}); $chr = ord($data[$epos]);
++$epos; if ($this->isCharMode($chr, ENC_EDF)) {
$temp_cw[] = $chr; ++$epos;
++$field_lenght; $temp_cw[] = $chr;
if (($field_lenght == 4) OR ($epos == $data_lenght)) { ++$field_lenght;
if ($field_lenght < 4) { }
if (($field_lenght == 4) OR ($epos == $data_lenght) OR !$this->isCharMode($chr, ENC_EDF)) {
if ($field_lenght < 4) { echo $field_lenght."\n";
// set unlatch character // set unlatch character
$temp_cw[] = 0x1f; $temp_cw[] = 0x1f;
++$field_lenght; ++$field_lenght;
$enc = ENC_ASCII;
// fill empty characters // fill empty characters
for ($i = $field_lenght; $i < 4; ++$i) { for ($i = $field_lenght; $i < 4; ++$i) {
$temp_cw[] = 0; $temp_cw[] = 0;
} }
$enc = ENC_ASCII;
} }
// encodes four data characters in three codewords // encodes four data characters in three codewords
$cw[] = (($temp_cw[0] & 0x3F) << 2) + (($temp_cw[1] & 0x30) >> 4); $tcw = (($temp_cw[0] & 0x3F) << 2) + (($temp_cw[1] & 0x30) >> 4);
$cw[] = (($temp_cw[1] & 0x0F) << 4) + (($temp_cw[2] & 0x3C) >> 2); if ($tcw > 0) {
$cw[] = (($temp_cw[2] & 0x03) << 6) + ($temp_cw[3] & 0x3F); $cw[] = $tcw;
$cw_num += 3; $cw_num++;
}
$tcw= (($temp_cw[1] & 0x0F) << 4) + (($temp_cw[2] & 0x3C) >> 2);
if ($tcw > 0) {
$cw[] = $tcw;
$cw_num++;
}
$tcw = (($temp_cw[2] & 0x03) << 6) + ($temp_cw[3] & 0x3F);
if ($tcw > 0) {
$cw[] = $tcw;
$cw_num++;
}
$temp_cw = array(); $temp_cw = array();
$pos = $epos; $pos = $epos;
$field_lenght = 0; $field_lenght = 0;
} if ($enc == ENC_ASCII) {
// 1. If the EDIFACT encoding is at the point of starting a new triple symbol character and if the look-ahead test (starting at step J) indicates another mode, switch to that mode.
if ($field_lenght == 0) {
// get remaining number of data symbols
$cwr = ($this->getMaxDataCodewords($cw_num + 2) - $cw_num);
if ($cwr < 3) {
// return to ascii without unlatch
$enc = ENC_ASCII;
break; // exit from EDIFACT mode break; // exit from EDIFACT mode
} else {
$newenc = $this->lookAheadTest($data, $pos, $enc);
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 EDIFACT mode
}
} }
} }
} } while ($epos < $data_lenght);
break; break;
} }
case ENC_BASE256: { // G. While in Base 256 (B256) encodation case ENC_BASE256: { // G. While in Base 256 (B256) encodation
@ -908,7 +910,7 @@ class Datamatrix {
break; // exit from B256 mode break; // exit from B256 mode
} else { } else {
// 2. Otherwise, process the next character in Base 256 encodation. // 2. Otherwise, process the next character in Base 256 encodation.
$chr = ord($data{($pos)}); $chr = ord($data[$pos]);
++$pos; ++$pos;
$temp_cw[] = $chr; $temp_cw[] = $chr;
++$field_lenght; ++$field_lenght;
@ -1076,7 +1078,6 @@ class Datamatrix {
return $marr; return $marr;
} }
/** /**
* Build a placement map. * Build a placement map.
* (Annex F - ECC 200 symbol character placement) * (Annex F - ECC 200 symbol character placement)
@ -1085,7 +1086,7 @@ class Datamatrix {
* @return array * @return array
* @protected * @protected
*/ */
protected function getPlacemetMap($nrow, $ncol) { protected function getPlacementMap($nrow, $ncol) {
// initialize array with zeros // initialize array with zeros
$marr = array_fill(0, ($nrow * $ncol), 0); $marr = array_fill(0, ($nrow * $ncol), 0);
// set starting values // set starting values

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff