30
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-06-05 23:30:47 +00:00
This commit is contained in:
nick 2011-12-13 20:25:29 +00:00
parent 46fe44c47c
commit d8a89a1775
3 changed files with 33 additions and 25 deletions

View File

@ -1,3 +1,6 @@
5.9.140 (2011-12-13)
- SVG now supports embedded images encoded as base64.
5.9.139 (2011-12-11) 5.9.139 (2011-12-11)
- Spot color methods were fixed. - Spot color methods were fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 5.9.139 Version: 5.9.140
Release date: 2011-12-11 Release date: 2011-12-13
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2011: Copyright (c) 2002-2011:

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 5.9.139 // Version : 5.9.140
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2011-12-11 // Last Update : 2011-12-13
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com // 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. // 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.
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -138,7 +138,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 5.9.139 * @version 5.9.140
*/ */
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
@ -150,7 +150,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> * 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 5.9.139 * @version 5.9.140
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF { class TCPDF {
@ -161,7 +161,7 @@ class TCPDF {
* Current TCPDF version. * Current TCPDF version.
* @private * @private
*/ */
private $tcpdf_version = '5.9.139'; private $tcpdf_version = '5.9.140';
// Protected properties // Protected properties
@ -28624,26 +28624,31 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$this->StartTransform(); $this->StartTransform();
$this->SVGTransform($tm); $this->SVGTransform($tm);
$obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h); $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h);
// fix image path if (preg_match('/^data:image\/[^;]+;base64,/', $img, $m) > 0) {
if (!$this->empty_string($this->svgdir) AND (($img{0} == '.') OR (basename($img) == $img))) { // embedded image encoded as base64
// replace relative path with full server path $img = '@'.base64_decode(substr($img, strlen($m[0])));
$img = $this->svgdir.'/'.$img; } else {
} // fix image path
if (($img[0] == '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { if (!$this->empty_string($this->svgdir) AND (($img{0} == '.') OR (basename($img) == $img))) {
$findroot = strpos($img, $_SERVER['DOCUMENT_ROOT']); // replace relative path with full server path
if (($findroot === false) OR ($findroot > 1)) { $img = $this->svgdir.'/'.$img;
if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') { }
$img = substr($_SERVER['DOCUMENT_ROOT'], 0, -1).$img; if (($img[0] == '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
} else { $findroot = strpos($img, $_SERVER['DOCUMENT_ROOT']);
$img = $_SERVER['DOCUMENT_ROOT'].$img; if (($findroot === false) OR ($findroot > 1)) {
if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') {
$img = substr($_SERVER['DOCUMENT_ROOT'], 0, -1).$img;
} else {
$img = $_SERVER['DOCUMENT_ROOT'].$img;
}
} }
} }
} $img = urldecode($img);
$img = urldecode($img); $testscrtype = @parse_url($img);
$testscrtype = @parse_url($img); if (!isset($testscrtype['query']) OR empty($testscrtype['query'])) {
if (!isset($testscrtype['query']) OR empty($testscrtype['query'])) { // convert URL to server path
// convert URL to server path $img = str_replace(K_PATH_URL, K_PATH_MAIN, $img);
$img = str_replace(K_PATH_URL, K_PATH_MAIN, $img); }
} }
$this->Image($img, $x, $y, $w, $h); $this->Image($img, $x, $y, $w, $h);
$this->StopTransform(); $this->StopTransform();