32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-01 03:02:32 +00:00

6.0.067 (2014-04-21)

- startLayer() method signature was changed to include a new "lock" parameter.
This commit is contained in:
nicolaasuni 2014-04-21 12:46:00 +01:00
parent 0eb0152409
commit f545d6dce7
5 changed files with 30 additions and 15 deletions

View File

@ -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) 6.0.066 (2014-04-20)
- Bug #908 "Linebreak is not considered when getting length of the next string" was fixed. - Bug #908 "Linebreak is not considered when getting length of the next string" was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 6.0.066 Version: 6.0.067
Release date: 2014-04-20 Release date: 2014-04-21
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2014: Copyright (c) 2002-2014:

View File

@ -1,6 +1,6 @@
{ {
"name": "tecnick.com/tcpdf", "name": "tecnick.com/tcpdf",
"version": "6.0.066", "version": "6.0.067",
"homepage": "http://www.tcpdf.org/", "homepage": "http://www.tcpdf.org/",
"type": "library", "type": "library",
"description": "TCPDF is a PHP class for generating PDF documents.", "description": "TCPDF is a PHP class for generating PDF documents.",

View File

@ -55,7 +55,7 @@ class TCPDF_STATIC {
* Current TCPDF version. * Current TCPDF version.
* @private static * @private static
*/ */
private static $tcpdf_version = '6.0.066'; private static $tcpdf_version = '6.0.067';
/** /**
* String alias for total number of pages. * String alias for total number of pages.
@ -2764,6 +2764,7 @@ class TCPDF_STATIC {
* @public static * @public static
*/ */
public static function fileGetContents($file) { public static function fileGetContents($file) {
//$file = html_entity_decode($file);
// array of possible alternative paths/URLs // array of possible alternative paths/URLs
$alt = array($file); $alt = array($file);
// replace URL relative path with full real server path // replace URL relative path with full real server path
@ -2800,6 +2801,10 @@ class TCPDF_STATIC {
$alt[] = $tmp; $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) { foreach ($alt as $f) {
$ret = @file_get_contents($f); $ret = @file_get_contents($f);
if (($ret === FALSE) if (($ret === FALSE)
@ -2808,7 +2813,7 @@ class TCPDF_STATIC {
AND preg_match('%^(https?|ftp)://%', $f)) { AND preg_match('%^(https?|ftp)://%', $f)) {
// try to get remote file data using cURL // try to get remote file data using cURL
$cs = curl_init(); // curl session $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_BINARYTRANSFER, true);
curl_setopt($cs, CURLOPT_FAILONERROR, true); curl_setopt($cs, CURLOPT_FAILONERROR, true);
curl_setopt($cs, CURLOPT_RETURNTRANSFER, true); curl_setopt($cs, CURLOPT_RETURNTRANSFER, true);

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 6.0.066 // Version : 6.0.067
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2014-04-20 // Last Update : 2014-04-21
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -104,7 +104,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p> * Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @author Nicola Asuni * @author Nicola Asuni
* @version 6.0.066 * @version 6.0.067
*/ */
// TCPDF configuration // 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> * 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 * @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions. * @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 * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF { class TCPDF {
@ -9701,13 +9701,18 @@ class TCPDF {
$lyrobjs = ''; $lyrobjs = '';
$lyrobjs_print = ''; $lyrobjs_print = '';
$lyrobjs_view = ''; $lyrobjs_view = '';
$lyrobjs_lock = '';
foreach ($this->pdflayers as $layer) { foreach ($this->pdflayers as $layer) {
$lyrobjs .= ' '.$layer['objid'].' 0 R'; $layer_obj_ref = ' '.$layer['objid'].' 0 R';
$lyrobjs .= $layer_obj_ref;
if ($layer['print']) { if ($layer['print']) {
$lyrobjs_print .= ' '.$layer['objid'].' 0 R'; $lyrobjs_print .= $layer_obj_ref;
} }
if ($layer['view']) { 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.']'; $out .= ' /OCProperties << /OCGs ['.$lyrobjs.']';
@ -9717,6 +9722,7 @@ class TCPDF {
$out .= ' /BaseState /ON'; $out .= ' /BaseState /ON';
$out .= ' /ON ['.$lyrobjs_print.']'; $out .= ' /ON ['.$lyrobjs_print.']';
$out .= ' /OFF ['.$lyrobjs_view.']'; $out .= ' /OFF ['.$lyrobjs_view.']';
$out .= ' /Locked ['.$lyrobjs_lock.']';
$out .= ' /Intent /View'; $out .= ' /Intent /View';
$out .= ' /AS ['; $out .= ' /AS [';
$out .= ' << /Event /Print /OCGs ['.$lyrobjs.'] /Category [/Print] >>'; $out .= ' << /Event /Print /OCGs ['.$lyrobjs.'] /Category [/Print] >>';
@ -13678,10 +13684,11 @@ class TCPDF {
* @param $name (string) Layer name (only a-z letters and numbers). Leave empty for automatic name. * @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 $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 $view (boolean) Set to true to view this layer.
* @param $lock (boolean) If true lock the layer
* @public * @public
* @since 5.9.102 (2011-07-13) * @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) { if ($this->state != 2) {
return; return;
} }
@ -13691,7 +13698,7 @@ class TCPDF {
} else { } else {
$name = preg_replace('/[^a-zA-Z0-9_\-]/', '', $name); $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->openMarkedContent = true;
$this->_out('/OC /'.$layer.' BDC'); $this->_out('/OC /'.$layer.' BDC');
} }