diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 967f68b..ffb4056 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,9 @@ +6.0.079 (2014-05-19) + - Patch item #69 "Named destinations, HTML internal and external links" was merged. + - Bug item #920 "hyphenateText() should not hyphenate the content of style-tags in HTML mode" was fixed. + - Image method now trigs an error in case the cache is now writeable. + - Fixed issue with layer default status. + 6.0.078 (2014-05-12) - A warning issue in addTTFfont() method was fixed. - Fonts were updated to include cbbox metrics. diff --git a/README.TXT b/README.TXT index cd52605..dc6c50f 100644 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 6.0.078 -Release date: 2014-05-12 +Version: 6.0.079 +Release date: 2014-05-19 Author: Nicola Asuni Copyright (c) 2002-2014: diff --git a/composer.json b/composer.json index 8f0e7d6..35561d6 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tecnick.com/tcpdf", - "version": "6.0.078", + "version": "6.0.079", "homepage": "http://www.tcpdf.org/", "type": "library", "description": "TCPDF is a PHP class for generating PDF documents.", diff --git a/include/tcpdf_static.php b/include/tcpdf_static.php index 522f3cc..065be6f 100644 --- a/include/tcpdf_static.php +++ b/include/tcpdf_static.php @@ -55,7 +55,7 @@ class TCPDF_STATIC { * Current TCPDF version. * @private static */ - private static $tcpdf_version = '6.0.078'; + private static $tcpdf_version = '6.0.079'; /** * String alias for total number of pages. @@ -1569,7 +1569,7 @@ class TCPDF_STATIC { $length = strlen($name); for ($i = 0; $i < $length; ++$i) { $chr = $name[$i]; - if (preg_match('/[0-9a-zA-Z]/', $chr) == 1) { + if (preg_match('/[0-9a-zA-Z#_=-]/', $chr) == 1) { $escname .= $chr; } else { $escname .= sprintf('#%02X', ord($chr)); diff --git a/tcpdf.php b/tcpdf.php index 79d9cab..d05d929 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 6.0.078 + * @version 6.0.079 */ // 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.
* @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 6.0.078 + * @version 6.0.079 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -6861,6 +6861,9 @@ class TCPDF { $original_file = $file; $file = TCPDF_STATIC::getObjFilename('img'); $fp = fopen($file, 'w'); + if (!$fp) { + $this->Error('Unable to write file: '.$file); + } fwrite($fp, $imgdata); fclose($fp); unset($imgdata); @@ -9713,17 +9716,13 @@ class TCPDF { //$out .= ' /PieceInfo <<>>'; if (!empty($this->pdflayers)) { $lyrobjs = ''; - $lyrobjs_print = ''; - $lyrobjs_view = ''; + $lyrobjs_off = ''; $lyrobjs_lock = ''; foreach ($this->pdflayers as $layer) { $layer_obj_ref = ' '.$layer['objid'].' 0 R'; $lyrobjs .= $layer_obj_ref; - if ($layer['print']) { - $lyrobjs_print .= $layer_obj_ref; - } - if ($layer['view']) { - $lyrobjs_view .= $layer_obj_ref; + if ($layer['view'] === false) { + $lyrobjs_off .= $layer_obj_ref; } if ($layer['lock']) { $lyrobjs_lock .= $layer_obj_ref; @@ -9734,8 +9733,7 @@ class TCPDF { $out .= ' /Name '.$this->_textstring('Layers', $oid); $out .= ' /Creator '.$this->_textstring('TCPDF', $oid); $out .= ' /BaseState /ON'; - $out .= ' /ON ['.$lyrobjs_print.']'; - $out .= ' /OFF ['.$lyrobjs_view.']'; + $out .= ' /OFF ['.$lyrobjs_off.']'; $out .= ' /Locked ['.$lyrobjs_lock.']'; $out .= ' /Intent /View'; $out .= ' /AS ['; @@ -21995,7 +21993,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: if (isset($dictionary[$word_string])) { return TCPDF_FONTS::UTF8StringToArray($dictionary[$word_string], $this->isunicode, $this->CurrentFont); } - // suround word with '_' characters + // surround word with '_' characters $tmpword = array_merge(array(95), $word, array(95)); $tmpnumchars = $numchars + 2; $maxpos = $tmpnumchars - $charmin; @@ -22055,6 +22053,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $word = array(); // last word $txtarr = array(); // text to be returned $intag = false; // true if we are inside an HTML tag + $skip = false; // true to skip hyphenation if (!is_array($patterns)) { $patterns = TCPDF_STATIC::getHyphenPatternsFromTEX($patterns); } @@ -22062,7 +22061,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $unichars = TCPDF_FONTS::UTF8StringToArray($text, $this->isunicode, $this->CurrentFont); // for each char foreach ($unichars as $char) { - if ((!$intag) AND TCPDF_FONT_DATA::$uni_type[$char] == 'L') { + if ((!$intag) AND (!$skip) AND TCPDF_FONT_DATA::$uni_type[$char] == 'L') { // letter character $word[] = $char; } else { @@ -22079,6 +22078,16 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: } elseif ($intag AND (chr($char) == '>')) { // end of HTML tag $intag = false; + // check for style tag + if (empty(array_diff(array_slice($txtarr, -6, 5), array(115, 116, 121, 108, 101)))) { // = 'style' + if (empty(array_diff(array_slice($txtarr, -7, 1), array(47)))) { // '/' = 47 + // closing style tag + $skip = false; + } else { + // opening style tag + $skip = true; + } + } } } }