32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-12-23 17:08:53 +00:00
This commit is contained in:
nicolaasuni 2011-05-06 22:32:18 +02:00
parent d393f2943c
commit 93e096d631
4 changed files with 70 additions and 64 deletions

View File

@ -1,3 +1,6 @@
5.9.076 (2011-05-06)
- Bug item #3298264 "codebar 93 error" was fixed.
5.9.075 (2011-05-02)
- Table header alignment when using WriteHTMLCell() or MultiCell() was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 5.9.075
Release date: 2011-05-02
Version: 5.9.076
Release date: 2011-05-06
Author: Nicola Asuni
Copyright (c) 2002-2011:

View File

@ -1,13 +1,13 @@
<?php
//============================================================+
// File name : barcodes.php
// Version : 1.0.012
// Version : 1.0.013
// Begin : 2008-06-09
// Last Update : 2010-12-16
// Last Update : 2011-05-06
// 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)
// -------------------------------------------------------------------
// Copyright (C) 2008-2010 Nicola Asuni - Tecnick.com S.r.l.
// Copyright (C) 2008-2011 Nicola Asuni - Tecnick.com S.r.l.
//
// 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.012
* @version 1.0.013
*/
/**
* @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.012
* @version 1.0.013
* @author Nicola Asuni
*/
class TCPDFBarcode {
@ -392,54 +392,54 @@ class TCPDFBarcode {
* @protected
*/
protected function barcode_code93($code) {
$chr['0'] = '131112';
$chr['1'] = '111213';
$chr['2'] = '111312';
$chr['3'] = '111411';
$chr['4'] = '121113';
$chr['5'] = '121212';
$chr['6'] = '121311';
$chr['7'] = '111114';
$chr['8'] = '131211';
$chr['9'] = '141111';
$chr['A'] = '211113';
$chr['B'] = '211212';
$chr['C'] = '211311';
$chr['D'] = '221112';
$chr['E'] = '221211';
$chr['F'] = '231111';
$chr['G'] = '112113';
$chr['H'] = '112212';
$chr['I'] = '112311';
$chr['J'] = '122112';
$chr['K'] = '132111';
$chr['L'] = '111123';
$chr['M'] = '111222';
$chr['N'] = '111321';
$chr['O'] = '121122';
$chr['P'] = '131121';
$chr['Q'] = '212112';
$chr['R'] = '212211';
$chr['S'] = '211122';
$chr['T'] = '211221';
$chr['U'] = '221121';
$chr['V'] = '222111';
$chr['W'] = '112122';
$chr['X'] = '112221';
$chr['Y'] = '122121';
$chr['Z'] = '123111';
$chr['-'] = '121131';
$chr['.'] = '311112';
$chr[' '] = '311211';
$chr['$'] = '321111';
$chr['/'] = '112131';
$chr['+'] = '113121';
$chr['%'] = '211131';
$chr[48] = '131112'; // 0
$chr[49] = '111213'; // 1
$chr[50] = '111312'; // 2
$chr[51] = '111411'; // 3
$chr[52] = '121113'; // 4
$chr[53] = '121212'; // 5
$chr[54] = '121311'; // 6
$chr[55] = '111114'; // 7
$chr[56] = '131211'; // 8
$chr[57] = '141111'; // 9
$chr[65] = '211113'; // A
$chr[66] = '211212'; // B
$chr[67] = '211311'; // C
$chr[68] = '221112'; // D
$chr[69] = '221211'; // E
$chr[70] = '231111'; // F
$chr[71] = '112113'; // G
$chr[72] = '112212'; // H
$chr[72] = '112311'; // I
$chr[74] = '122112'; // J
$chr[75] = '132111'; // K
$chr[76] = '111123'; // L
$chr[77] = '111222'; // M
$chr[78] = '111321'; // N
$chr[79] = '121122'; // O
$chr[80] = '131121'; // P
$chr[81] = '212112'; // Q
$chr[82] = '212211'; // R
$chr[83] = '211122'; // S
$chr[84] = '211221'; // T
$chr[85] = '221121'; // U
$chr[86] = '222111'; // V
$chr[87] = '112122'; // W
$chr[88] = '112221'; // X
$chr[89] = '122121'; // Y
$chr[90] = '123111'; // Z
$chr[45] = '121131'; // -
$chr[46] = '311112'; // .
$chr[32] = '311211'; //
$chr[36] = '321111'; // $
$chr[47] = '112131'; // /
$chr[43] = '113121'; // +
$chr[37] = '211131'; // %
$chr[128] = '121221'; // ($)
$chr[129] = '311121'; // (/)
$chr[130] = '122211'; // (+)
$chr[131] = '312111'; // (%)
$chr['*'] = '111141';
$chr[42] = '111141'; // start-stop
$code = strtoupper($code);
$encode = array(
chr(0) => chr(131).'U', chr(1) => chr(128).'A', chr(2) => chr(128).'B', chr(3) => chr(128).'C',
@ -483,14 +483,14 @@ class TCPDFBarcode {
$code_ext .= $encode[$code{$i}];
}
// checksum
$code .= $this->checksum_code93($code);
$code_ext .= $this->checksum_code93($code_ext);
// add start and stop codes
$code = '*'.$code.'*';
$code = '*'.$code_ext.'*';
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
$k = 0;
$clen = strlen($code);
for ($i = 0; $i < $clen; ++$i) {
$char = $code{$i};
$char = ord($code{$i});
if(!isset($chr[$char])) {
// invalid character
return false;
@ -524,9 +524,10 @@ class TCPDFBarcode {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%');
'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%',
'<', '=', '>', '?');
// translate special characters
$code = strtr($code, chr(128).chr(129).chr(130).chr(131), '$/+%');
$code = strtr($code, chr(128).chr(131).chr(129).chr(130), '<=>?');
$len = strlen($code);
// calculate check digit C
$p = 1;
@ -555,7 +556,10 @@ class TCPDFBarcode {
}
$check %= 47;
$k = $chars[$check];
return $c.$k;
$checksum = $c.$k;
// resto respecial characters
$checksum = strtr($checksum, '<=>?', chr(128).chr(131).chr(129).chr(130));
return $checksum;
}
/**
@ -1544,7 +1548,6 @@ class TCPDFBarcode {
'-' => '112111',
'S' => '112211'
);
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
$k = 0;
$w = 0;

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 5.9.075
// Version : 5.9.076
// Begin : 2002-08-03
// Last Update : 2011-05-02
// Last Update : 2011-05-06
// 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.
// -------------------------------------------------------------------
@ -134,7 +134,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 5.9.075
* @version 5.9.076
*/
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
@ -146,7 +146,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.075
* @version 5.9.076
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF {
@ -157,7 +157,7 @@ class TCPDF {
* Current TCPDF version.
* @private
*/
private $tcpdf_version = '5.9.075';
private $tcpdf_version = '5.9.076';
// Protected properties
@ -23449,7 +23449,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
* @param $filler (string) string used to fill the space between text and page number.
* @param $toc_name (string) name to use for TOC bookmark.
* @param $style (string) Font style for title: B = Bold, I = Italic, BI = Bold + Italic.
* @param $color (array) RGB color array for title (values from 0 to 255).
* @param $color (array) RGB color array for bookmark title (values from 0 to 255).
* @public
* @author Nicola Asuni
* @since 4.5.000 (2009-01-02)