mirror of
https://github.com/vdm-io/tcpdf.git
synced 2024-11-22 04:45:17 +00:00
6.0.056 (2014-01-25)
- The automatic chache folder selection now works also with some restricted hosting environments. - CSS text-transform property is now supported (requires the multibyte string library for php) - see examle n. 061 (Thanks to Walter Ferraz). - Bug #884 "Parsing error prev tag looking for" was fixed.
This commit is contained in:
parent
e2ee99bd0e
commit
4bfe37b111
@ -1,3 +1,8 @@
|
||||
6.0.056 (2014-01-25)
|
||||
- The automatic chache folder selection now works also with some restricted hosting environments.
|
||||
- CSS text-transform property is now supported (requires the multibyte string library for php) - see examle n. 061 (Thanks to Walter Ferraz).
|
||||
- Bug #884 "Parsing error prev tag looking for" was fixed.
|
||||
|
||||
6.0.055 (2014-01-15)
|
||||
- Bug #880 "Error detecting hX tags (h1,h2..)" was fixed
|
||||
- Bug #879 "Thead on the second page inherits style of previous tr" was fixed
|
||||
|
@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
|
||||
------------------------------------------------------------
|
||||
|
||||
Name: TCPDF
|
||||
Version: 6.0.055
|
||||
Release date: 2014-01-15
|
||||
Version: 6.0.056
|
||||
Release date: 2014-01-25
|
||||
Author: Nicola Asuni
|
||||
|
||||
Copyright (c) 2002-2014:
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tecnick.com/tcpdf",
|
||||
"version": "6.0.055",
|
||||
"version": "6.0.056",
|
||||
"homepage": "http://www.tcpdf.org/",
|
||||
"type": "library",
|
||||
"description": "TCPDF is a PHP class for generating PDF documents.",
|
||||
|
@ -2,13 +2,13 @@
|
||||
//============================================================+
|
||||
// File name : tcpdf_config.php
|
||||
// Begin : 2004-06-11
|
||||
// Last Update : 2013-05-16
|
||||
// Last Update : 2014-01-25
|
||||
//
|
||||
// Description : Configuration file for TCPDF.
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
// Copyright (C) 2004-2013 Nicola Asuni - Tecnick.com LTD
|
||||
// Copyright (C) 2004-2014 Nicola Asuni - Tecnick.com LTD
|
||||
//
|
||||
// This file is part of TCPDF software library.
|
||||
//
|
||||
@ -36,7 +36,10 @@
|
||||
* @since 2004-10-27
|
||||
*/
|
||||
|
||||
// If you define the constant K_TCPDF_EXTERNAL_CONFIG, the following settings will be ignored.
|
||||
// IMPORTANT:
|
||||
// If you define the constant K_TCPDF_EXTERNAL_CONFIG, all the following settings will be ignored.
|
||||
// If you use the tcpdf_autoconfig.php, then you can overwrite some values here.
|
||||
|
||||
|
||||
/**
|
||||
* Installation path (/var/www/tcpdf/).
|
||||
@ -76,7 +79,7 @@
|
||||
/**
|
||||
* Cache directory for temporary files (full path).
|
||||
*/
|
||||
define ('K_PATH_CACHE', sys_get_temp_dir().'/');
|
||||
//define ('K_PATH_CACHE', '/tmp/');
|
||||
|
||||
/**
|
||||
* Generic name for a blank image.
|
||||
@ -210,7 +213,7 @@ define('K_THAI_TOPCHARS', true);
|
||||
define('K_TCPDF_CALLS_IN_HTML', true);
|
||||
|
||||
/**
|
||||
* If true adn PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
|
||||
* If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
|
||||
*/
|
||||
define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//============================================================+
|
||||
// File name : example_061.php
|
||||
// Begin : 2010-05-24
|
||||
// Last Update : 2013-05-14
|
||||
// Last Update : 2014-01-25
|
||||
//
|
||||
// Description : Example 061 for TCPDF class
|
||||
// XHTML + CSS
|
||||
@ -138,6 +138,15 @@ $html = <<<EOF
|
||||
border-color: green #FF00FF blue red;
|
||||
text-align: center;
|
||||
}
|
||||
.lowercase {
|
||||
text-transform: lowercase;
|
||||
}
|
||||
.uppercase {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.capitalize {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1 class="title">Example of <i style="color:#990000">XHTML + CSS</i></h1>
|
||||
@ -146,7 +155,12 @@ $html = <<<EOF
|
||||
|
||||
<p id="second">Example of paragraph with ID selector. <span>Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.</span></p>
|
||||
|
||||
<div class="test">example of DIV with border and fill.<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus.</div>
|
||||
<div class="test">example of DIV with border and fill.
|
||||
<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
<br /><span class="lowercase">text-transform <b>LOWERCASE</b> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>
|
||||
<br /><span class="uppercase">text-transform <b>uppercase</b> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>
|
||||
<br /><span class="capitalize">text-transform <b>cAPITALIZE</b> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
|
@ -55,7 +55,7 @@ class TCPDF_STATIC {
|
||||
* Current TCPDF version.
|
||||
* @private static
|
||||
*/
|
||||
private static $tcpdf_version = '6.0.055';
|
||||
private static $tcpdf_version = '6.0.056';
|
||||
|
||||
/**
|
||||
* String alias for total number of pages.
|
||||
|
44
tcpdf.php
44
tcpdf.php
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf.php
|
||||
// Version : 6.0.055
|
||||
// Version : 6.0.056
|
||||
// Begin : 2002-08-03
|
||||
// Last Update : 2014-01-15
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||
@ -104,7 +104,7 @@
|
||||
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
|
||||
* @package com.tecnick.tcpdf
|
||||
* @author Nicola Asuni
|
||||
* @version 6.0.055
|
||||
* @version 6.0.056
|
||||
*/
|
||||
|
||||
// TCPDF configuration
|
||||
@ -128,7 +128,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.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 6.0.055
|
||||
* @version 6.0.056
|
||||
* @author Nicola Asuni - info@tecnick.com
|
||||
*/
|
||||
class TCPDF {
|
||||
@ -3638,7 +3638,7 @@ class TCPDF {
|
||||
$gvars = $this->getGraphicVars();
|
||||
if (!empty($this->theadMargins['gvars'])) {
|
||||
// set the correct graphic style
|
||||
$this->setGraphicVars($this->theadMargins['gvars']); // DEBUG
|
||||
$this->setGraphicVars($this->theadMargins['gvars']);
|
||||
$this->rMargin = $gvars['rMargin'];
|
||||
$this->lMargin = $gvars['lMargin'];
|
||||
}
|
||||
@ -7738,7 +7738,7 @@ class TCPDF {
|
||||
// remove buffer file from cache
|
||||
unlink($this->buffer);
|
||||
}
|
||||
if ($destroyall AND isset($this->cached_files) AND !empty($this->cached_files)) {
|
||||
if ($destroyall AND !empty($this->cached_files)) {
|
||||
// remove cached files
|
||||
foreach ($this->cached_files as $cachefile) {
|
||||
if (is_file($cachefile)) {
|
||||
@ -16369,6 +16369,7 @@ class TCPDF {
|
||||
$dom[$key]['align'] = '';
|
||||
$dom[$key]['listtype'] = '';
|
||||
$dom[$key]['text-indent'] = 0;
|
||||
$dom[$key]['text-transform'] = '';
|
||||
$dom[$key]['border'] = array();
|
||||
$dom[$key]['dir'] = $this->rtl?'rtl':'ltr';
|
||||
$thead = false; // true when we are inside the THEAD tag
|
||||
@ -16421,6 +16422,7 @@ class TCPDF {
|
||||
$dom[$key]['fgcolor'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fgcolor'];
|
||||
$dom[$key]['strokecolor'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['strokecolor'];
|
||||
$dom[$key]['align'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['align'];
|
||||
$dom[$key]['text-transform'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['text-transform'];
|
||||
$dom[$key]['dir'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['dir'];
|
||||
if (isset($dom[($dom[($dom[$key]['parent'])]['parent'])]['listtype'])) {
|
||||
$dom[$key]['listtype'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['listtype'];
|
||||
@ -16492,6 +16494,7 @@ class TCPDF {
|
||||
$dom[$key]['align'] = $dom[$parentkey]['align'];
|
||||
$dom[$key]['listtype'] = $dom[$parentkey]['listtype'];
|
||||
$dom[$key]['text-indent'] = $dom[$parentkey]['text-indent'];
|
||||
$dom[$key]['text-transform'] = $dom[$parentkey]['text-transform'];
|
||||
$dom[$key]['border'] = array();
|
||||
$dom[$key]['dir'] = $dom[$parentkey]['dir'];
|
||||
}
|
||||
@ -16542,6 +16545,10 @@ class TCPDF {
|
||||
$dom[$key]['text-indent'] = $dom[$parentkey]['text-indent'];
|
||||
}
|
||||
}
|
||||
// text-transform
|
||||
if (isset($dom[$key]['style']['text-transform'])) {
|
||||
$dom[$key]['text-transform'] = $dom[$key]['style']['text-transform'];
|
||||
}
|
||||
// font size
|
||||
if (isset($dom[$key]['style']['font-size'])) {
|
||||
$fsize = trim($dom[$key]['style']['font-size']);
|
||||
@ -16934,10 +16941,33 @@ class TCPDF {
|
||||
// text
|
||||
$dom[$key]['tag'] = false;
|
||||
$dom[$key]['block'] = false;
|
||||
//$element = str_replace(' ', TCPDF_FONTS::unichr(160, $this->isunicode), $element);
|
||||
$dom[$key]['value'] = stripslashes($this->unhtmlentities($element));
|
||||
$dom[$key]['parent'] = end($level);
|
||||
$dom[$key]['dir'] = $dom[$dom[$key]['parent']]['dir'];
|
||||
if (!empty($dom[$dom[$key]['parent']]['text-transform'])) {
|
||||
// text-transform for unicode requires mb_convert_case (Multibyte String Functions)
|
||||
if (function_exists('mb_convert_case')) {
|
||||
$ttm = array('capitalize' => MB_CASE_TITLE, 'uppercase' => MB_CASE_UPPER, 'lowercase' => MB_CASE_LOWER);
|
||||
if (isset($ttm[$dom[$dom[$key]['parent']]['text-transform']])) {
|
||||
$element = mb_convert_case($element, $ttm[$dom[$dom[$key]['parent']]['text-transform']], $this->encoding);
|
||||
}
|
||||
} elseif (!$this->isunicode) {
|
||||
switch ($dom[$dom[$key]['parent']]['text-transform']) {
|
||||
case 'capitalize': {
|
||||
$element = ucwords(strtolower($element));
|
||||
break;
|
||||
}
|
||||
case 'uppercase': {
|
||||
$element = strtoupper($element);
|
||||
break;
|
||||
}
|
||||
case 'lowercase': {
|
||||
$element = strtolower($element);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$dom[$key]['value'] = stripslashes($this->unhtmlentities($element));
|
||||
}
|
||||
++$elkey;
|
||||
++$key;
|
||||
|
@ -3,11 +3,11 @@
|
||||
// File name : tcpdf_autoconfig.php
|
||||
// Version : 1.0.000
|
||||
// Begin : 2013-05-16
|
||||
// Last Update : 2013-05-16
|
||||
// Last Update : 2014-01-25
|
||||
// Authors : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
// Copyright (C) 2011-2013 Nicola Asuni - Tecnick.com LTD
|
||||
// Copyright (C) 2011-2014 Nicola Asuni - Tecnick.com LTD
|
||||
//
|
||||
// This file is part of TCPDF software library.
|
||||
//
|
||||
@ -117,7 +117,11 @@ if (!defined('PDF_HEADER_LOGO_WIDTH')) {
|
||||
}
|
||||
|
||||
if (!defined('K_PATH_CACHE')) {
|
||||
define ('K_PATH_CACHE', sys_get_temp_dir().'/');
|
||||
$K_PATH_CACHE = ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir();
|
||||
if (substr($K_PATH_CACHE, -1) != '/') {
|
||||
$K_PATH_CACHE .= '/';
|
||||
}
|
||||
define ('K_PATH_CACHE', $K_PATH_CACHE);
|
||||
}
|
||||
|
||||
if (!defined('K_BLANK_IMAGE')) {
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf_parser.php
|
||||
// Version : 1.0.012
|
||||
// Version : 1.0.013
|
||||
// Begin : 2011-05-23
|
||||
// Last Update : 2013-11-17
|
||||
// Last Update : 2014-01-25
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3
|
||||
// -------------------------------------------------------------------
|
||||
// Copyright (C) 2011-2013 Nicola Asuni - Tecnick.com LTD
|
||||
// Copyright (C) 2011-2014 Nicola Asuni - Tecnick.com LTD
|
||||
//
|
||||
// This file is part of TCPDF software library.
|
||||
//
|
||||
@ -37,7 +37,7 @@
|
||||
* This is a PHP class for parsing PDF documents.<br>
|
||||
* @package com.tecnick.tcpdf
|
||||
* @author Nicola Asuni
|
||||
* @version 1.0.012
|
||||
* @version 1.0.013
|
||||
*/
|
||||
|
||||
// include class for decoding filters
|
||||
@ -234,7 +234,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]*<<(.*)>>/isU', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) {
|
||||
$trailer_data = $matches[1][0];
|
||||
if (!isset($xref['trailer']) OR empty($xref['trailer'])) {
|
||||
// get only the last updated version
|
||||
|
Loading…
Reference in New Issue
Block a user