diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index d78a4ce..50bbfea 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +6.0.067 (2014-04-21) + - startLayer() method signature was changed to include a new "lock" parameter. + 6.0.066 (2014-04-20) - Bug #908 "Linebreak is not considered when getting length of the next string" was fixed. diff --git a/README.TXT b/README.TXT index 297c770..e82f382 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.066 -Release date: 2014-04-20 +Version: 6.0.067 +Release date: 2014-04-21 Author: Nicola Asuni Copyright (c) 2002-2014: diff --git a/composer.json b/composer.json index f76e778..19b5294 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tecnick.com/tcpdf", - "version": "6.0.066", + "version": "6.0.067", "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 e90ba5a..985a964 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.066'; + private static $tcpdf_version = '6.0.067'; /** * String alias for total number of pages. @@ -2764,6 +2764,7 @@ class TCPDF_STATIC { * @public static */ public static function fileGetContents($file) { + //$file = html_entity_decode($file); // array of possible alternative paths/URLs $alt = array($file); // replace URL relative path with full real server path @@ -2800,6 +2801,10 @@ class TCPDF_STATIC { $alt[] = $tmp; } } + if (isset($_SERVER['SCRIPT_URI'])) { + $urldata = @parse_url($_SERVER['SCRIPT_URI']); + $alt[] = $urldata['scheme'].'://'.$urldata['host'].(($file[0] == '/') ? '' : '/').$file; + } foreach ($alt as $f) { $ret = @file_get_contents($f); if (($ret === FALSE) @@ -2808,7 +2813,7 @@ class TCPDF_STATIC { AND preg_match('%^(https?|ftp)://%', $f)) { // try to get remote file data using cURL $cs = curl_init(); // curl session - curl_setopt($cs, CURLOPT_URL, $file); + curl_setopt($cs, CURLOPT_URL, $f); curl_setopt($cs, CURLOPT_BINARYTRANSFER, true); curl_setopt($cs, CURLOPT_FAILONERROR, true); curl_setopt($cs, CURLOPT_RETURNTRANSFER, true); diff --git a/tcpdf.php b/tcpdf.php index 9f7bc86..daf4575 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 6.0.066 + * @version 6.0.067 */ // 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.066 + * @version 6.0.067 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -9701,13 +9701,18 @@ class TCPDF { $lyrobjs = ''; $lyrobjs_print = ''; $lyrobjs_view = ''; + $lyrobjs_lock = ''; foreach ($this->pdflayers as $layer) { - $lyrobjs .= ' '.$layer['objid'].' 0 R'; + $layer_obj_ref = ' '.$layer['objid'].' 0 R'; + $lyrobjs .= $layer_obj_ref; if ($layer['print']) { - $lyrobjs_print .= ' '.$layer['objid'].' 0 R'; + $lyrobjs_print .= $layer_obj_ref; } if ($layer['view']) { - $lyrobjs_view .= ' '.$layer['objid'].' 0 R'; + $lyrobjs_view .= $layer_obj_ref; + } + if ($layer['lock']) { + $lyrobjs_lock .= $layer_obj_ref; } } $out .= ' /OCProperties << /OCGs ['.$lyrobjs.']'; @@ -9717,6 +9722,7 @@ class TCPDF { $out .= ' /BaseState /ON'; $out .= ' /ON ['.$lyrobjs_print.']'; $out .= ' /OFF ['.$lyrobjs_view.']'; + $out .= ' /Locked ['.$lyrobjs_lock.']'; $out .= ' /Intent /View'; $out .= ' /AS ['; $out .= ' << /Event /Print /OCGs ['.$lyrobjs.'] /Category [/Print] >>'; @@ -13664,7 +13670,7 @@ class TCPDF { $out .= ' /Name '.$this->_textstring($layer['name'], $this->pdflayers[$key]['objid']); $out .= ' /Usage <<'; if (isset($layer['print']) AND ($layer['print'] !== NULL)) { - $out .= ' /Print <>'; + $out .= ' /Print <>'; } $out .= ' /View <>'; $out .= ' >> >>'; @@ -13678,10 +13684,11 @@ class TCPDF { * @param $name (string) Layer name (only a-z letters and numbers). Leave empty for automatic name. * @param $print (boolean|null) Set to TRUE to print this layer, FALSE to not print and NULL to not set this option * @param $view (boolean) Set to true to view this layer. + * @param $lock (boolean) If true lock the layer * @public * @since 5.9.102 (2011-07-13) */ - public function startLayer($name='', $print=true, $view=true) { + public function startLayer($name='', $print=true, $view=true, $lock=true) { if ($this->state != 2) { return; } @@ -13691,7 +13698,7 @@ class TCPDF { } else { $name = preg_replace('/[^a-zA-Z0-9_\-]/', '', $name); } - $this->pdflayers[] = array('layer' => $layer, 'name' => $name, 'print' => $print, 'view' => $view); + $this->pdflayers[] = array('layer' => $layer, 'name' => $name, 'print' => $print, 'view' => $view, 'lock' => $lock); $this->openMarkedContent = true; $this->_out('/OC /'.$layer.' BDC'); }