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)
- Spot color methods were fixed.

View File

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

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 5.9.139
// Version : 5.9.140
// 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
// 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>
* @package com.tecnick.tcpdf
* @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.
@ -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>
* @package com.tecnick.tcpdf
* @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
*/
class TCPDF {
@ -161,7 +161,7 @@ class TCPDF {
* Current TCPDF version.
* @private
*/
private $tcpdf_version = '5.9.139';
private $tcpdf_version = '5.9.140';
// Protected properties
@ -28624,26 +28624,31 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$this->StartTransform();
$this->SVGTransform($tm);
$obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h);
// fix image path
if (!$this->empty_string($this->svgdir) AND (($img{0} == '.') OR (basename($img) == $img))) {
// replace relative path with full server path
$img = $this->svgdir.'/'.$img;
}
if (($img[0] == '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
$findroot = strpos($img, $_SERVER['DOCUMENT_ROOT']);
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;
if (preg_match('/^data:image\/[^;]+;base64,/', $img, $m) > 0) {
// embedded image encoded as base64
$img = '@'.base64_decode(substr($img, strlen($m[0])));
} else {
// fix image path
if (!$this->empty_string($this->svgdir) AND (($img{0} == '.') OR (basename($img) == $img))) {
// replace relative path with full server path
$img = $this->svgdir.'/'.$img;
}
if (($img[0] == '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
$findroot = strpos($img, $_SERVER['DOCUMENT_ROOT']);
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);
$testscrtype = @parse_url($img);
if (!isset($testscrtype['query']) OR empty($testscrtype['query'])) {
// convert URL to server path
$img = str_replace(K_PATH_URL, K_PATH_MAIN, $img);
$img = urldecode($img);
$testscrtype = @parse_url($img);
if (!isset($testscrtype['query']) OR empty($testscrtype['query'])) {
// convert URL to server path
$img = str_replace(K_PATH_URL, K_PATH_MAIN, $img);
}
}
$this->Image($img, $x, $y, $w, $h);
$this->StopTransform();