32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-12-26 01:57:29 +00:00
This commit is contained in:
Nick 2011-10-12 14:17:06 +02:00
parent 116f8b3a53
commit 354739c739
3 changed files with 35 additions and 26 deletions

View File

@ -1,3 +1,6 @@
5.9.130 (2011-10-12)
- Now you can set image data strings on HTML img tag by encoding the image binary data in this way: $imgsrc = '@'.base64_encode($imgdata);
5.9.129 (2011-10-07)
- Core fonts metrics was fixed (replace all helvetica and times php files on fonts folder).
- Form fields support was improved and some problems were fixed (check the example n. 14).

View File

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

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 5.9.129
// Version : 5.9.130
// Begin : 2002-08-03
// Last Update : 2011-10-07
// Last Update : 2011-10-12
// 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.
// -------------------------------------------------------------------
@ -137,7 +137,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 5.9.129
* @version 5.9.130
*/
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
@ -149,7 +149,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.129
* @version 5.9.130
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF {
@ -160,7 +160,7 @@ class TCPDF {
* Current TCPDF version.
* @private
*/
private $tcpdf_version = '5.9.129';
private $tcpdf_version = '5.9.130';
// Protected properties
@ -23055,27 +23055,33 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
}
case 'img': {
if (isset($tag['attribute']['src'])) {
// check for images without protocol
if (preg_match('%^/{2}%', $tag['attribute']['src'])) {
$tag['attribute']['src'] = 'http:'.$tag['attribute']['src'];
}
// replace relative path with real server path
if (($tag['attribute']['src'][0] == '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
$findroot = strpos($tag['attribute']['src'], $_SERVER['DOCUMENT_ROOT']);
if (($findroot === false) OR ($findroot > 1)) {
if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') {
$tag['attribute']['src'] = substr($_SERVER['DOCUMENT_ROOT'], 0, -1).$tag['attribute']['src'];
} else {
$tag['attribute']['src'] = $_SERVER['DOCUMENT_ROOT'].$tag['attribute']['src'];
if ($tag['attribute']['src']{0} === '@') {
// data stream
$tag['attribute']['src'] = '@'.base64_decode(substr($tag['attribute']['src'], 1));
$type = '';
} else {
// check for images without protocol
if (preg_match('%^/{2}%', $tag['attribute']['src'])) {
$tag['attribute']['src'] = 'http:'.$tag['attribute']['src'];
}
// replace relative path with real server path
if (($tag['attribute']['src'][0] == '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
$findroot = strpos($tag['attribute']['src'], $_SERVER['DOCUMENT_ROOT']);
if (($findroot === false) OR ($findroot > 1)) {
if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') {
$tag['attribute']['src'] = substr($_SERVER['DOCUMENT_ROOT'], 0, -1).$tag['attribute']['src'];
} else {
$tag['attribute']['src'] = $_SERVER['DOCUMENT_ROOT'].$tag['attribute']['src'];
}
}
}
}
$tag['attribute']['src'] = htmlspecialchars_decode(urldecode($tag['attribute']['src']));
$type = $this->getImageFileType($tag['attribute']['src']);
$testscrtype = @parse_url($tag['attribute']['src']);
if (!isset($testscrtype['query']) OR empty($testscrtype['query'])) {
// convert URL to server path
$tag['attribute']['src'] = str_replace(K_PATH_URL, K_PATH_MAIN, $tag['attribute']['src']);
$tag['attribute']['src'] = htmlspecialchars_decode(urldecode($tag['attribute']['src']));
$type = $this->getImageFileType($tag['attribute']['src']);
$testscrtype = @parse_url($tag['attribute']['src']);
if (!isset($testscrtype['query']) OR empty($testscrtype['query'])) {
// convert URL to server path
$tag['attribute']['src'] = str_replace(K_PATH_URL, K_PATH_MAIN, $tag['attribute']['src']);
}
}
if (!isset($tag['width'])) {
$tag['width'] = 0;