32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-22 21:05:10 +00:00
This commit is contained in:
Nick 2011-09-14 10:33:35 +02:00
parent de504c4ea9
commit 7e042aacf7
4 changed files with 32 additions and 20 deletions

View File

@ -1,3 +1,6 @@
5.9.116 (2011-09-14)
- Datamatrix class was improved.
5.9.115 (2011-09-13) 5.9.115 (2011-09-13)
- Datamatrix barcode support was added (a new datamatrix.php file was added) - check example n. 50. - Datamatrix barcode support was added (a new datamatrix.php file was added) - check example n. 50.
- getBarcodeHTML() method was added on TCPDFBarcode and TCPDF2DBarcode classes to return an HTML representation of the barcode. - getBarcodeHTML() method was added on TCPDFBarcode and TCPDF2DBarcode classes to return an HTML representation of the barcode.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 5.9.115 Version: 5.9.116
Release date: 2011-09-13 Release date: 2011-09-14
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2011: Copyright (c) 2002-2011:

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : datamatrix.php // File name : datamatrix.php
// Version : 1.0.000 // Version : 1.0.001
// Begin : 2010-06-07 // Begin : 2010-06-07
// Last Update : 2011-09-13 // Last Update : 2011-09-14
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - 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)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -41,7 +41,7 @@
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @abstract Class to create datamatrix barcode arrays for TCPDF class. * @abstract Class to create datamatrix barcode arrays for TCPDF class.
* @author Nicola Asuni * @author Nicola Asuni
* @version 1.0.000 * @version 1.0.001
*/ */
// custom definitions // custom definitions
@ -110,7 +110,7 @@ define('ENC_ASCII_NUM', 7);
* @copyright 2010-2011 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com * @copyright 2010-2011 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://www.tcpdf.org * @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL * @license http://www.gnu.org/copyleft/lesser.html LGPL
* @version 1.0.000 * @version 1.0.001
*/ */
class Datamatrix { class Datamatrix {
@ -234,7 +234,7 @@ class Datamatrix {
/** /**
* This is the class constructor. * This is the class constructor.
* Creates a datamatrix object * Creates a datamatrix object
* @param $code (string) code to represent using datamatrix * @param $code (string) Code to represent using Datamatrix.
* (access public) * (access public)
*/ */
public function __construct($code) { public function __construct($code) {
@ -265,7 +265,7 @@ class Datamatrix {
// switch to ASCII encoding // switch to ASCII encoding
$cw[] = 124; $cw[] = 124;
++$nd; ++$nd;
} elseif ($this->last_enc != ENC_ASCII) { } elseif (($this->last_enc != ENC_ASCII) AND ($this->last_enc != ENC_BASE256)) {
// switch to ASCII encoding // switch to ASCII encoding
$cw[] = 254; $cw[] = 254;
++$nd; ++$nd;
@ -713,7 +713,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 (($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;
@ -861,6 +861,7 @@ class Datamatrix {
// 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;
@ -877,13 +878,21 @@ class Datamatrix {
} }
// 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. // 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) { if ($field_lenght == 0) {
$newenc = $this->lookAheadTest($data, $pos, $enc); // get remaining number of data symbols
if ($newenc != $enc) { $cwr = ($this->getMaxDataCodewords($cw_num + 2) - $cw_num);
// 1. If the look-ahead test (starting at step J) indicates another mode, switch to that mode. if ($cwr < 3) {
$enc = $newenc; // return to ascii without unlatch
$cw[] = $this->getSwitchEncodingCodeword($enc); $enc = ENC_ASCII;
++$cw_num;
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
}
} }
} }
} }

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 5.9.115 // Version : 5.9.116
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2011-09-13 // Last Update : 2011-09-14
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS. // License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS.
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -136,7 +136,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p> * Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @author Nicola Asuni * @author Nicola Asuni
* @version 5.9.115 * @version 5.9.116
*/ */
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
@ -148,7 +148,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php');
* TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br> * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions. * @brief PHP class for generating PDF documents without requiring external extensions.
* @version 5.9.115 * @version 5.9.116
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF { class TCPDF {
@ -159,7 +159,7 @@ class TCPDF {
* Current TCPDF version. * Current TCPDF version.
* @private * @private
*/ */
private $tcpdf_version = '5.9.115'; private $tcpdf_version = '5.9.116';
// Protected properties // Protected properties