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)
- 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.

View File

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

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : datamatrix.php
// Version : 1.0.000
// Version : 1.0.001
// 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
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@ -41,7 +41,7 @@
* @package com.tecnick.tcpdf
* @abstract Class to create datamatrix barcode arrays for TCPDF class.
* @author Nicola Asuni
* @version 1.0.000
* @version 1.0.001
*/
// 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
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @version 1.0.000
* @version 1.0.001
*/
class Datamatrix {
@ -234,7 +234,7 @@ class Datamatrix {
/**
* This is the class constructor.
* Creates a datamatrix object
* @param $code (string) code to represent using datamatrix
* @param $code (string) Code to represent using Datamatrix.
* (access public)
*/
public function __construct($code) {
@ -265,7 +265,7 @@ class Datamatrix {
// switch to ASCII encoding
$cw[] = 124;
++$nd;
} elseif ($this->last_enc != ENC_ASCII) {
} elseif (($this->last_enc != ENC_ASCII) AND ($this->last_enc != ENC_BASE256)) {
// switch to ASCII encoding
$cw[] = 254;
++$nd;
@ -713,7 +713,7 @@ class Datamatrix {
while ($pos < $data_lenght) {
switch ($enc) {
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.
$cw[] = (intval(substr($data, $pos, 2)) + 130);
++$cw_num;
@ -861,6 +861,7 @@ class Datamatrix {
// set unlatch character
$temp_cw[] = 0x1f;
++$field_lenght;
$enc = ENC_ASCII;
// fill empty characters
for ($i = $field_lenght; $i < 4; ++$i) {
$temp_cw[] = 0;
@ -877,6 +878,13 @@ 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.
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
} 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.
@ -887,6 +895,7 @@ class Datamatrix {
}
}
}
}
break;
}
case ENC_BASE256: { // G. While in Base 256 (B256) encodation

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 5.9.115
// Version : 5.9.116
// 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
// 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>
* @package com.tecnick.tcpdf
* @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.
@ -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>
* @package com.tecnick.tcpdf
* @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
*/
class TCPDF {
@ -159,7 +159,7 @@ class TCPDF {
* Current TCPDF version.
* @private
*/
private $tcpdf_version = '5.9.115';
private $tcpdf_version = '5.9.116';
// Protected properties