mirror of
https://github.com/vdm-io/tcpdf.git
synced 2025-01-26 13:48:24 +00:00
5.5.014
This commit is contained in:
parent
94b1c2f401
commit
e0d7ab903c
@ -1,3 +1,6 @@
|
||||
5.5.014 (2010-07-15)
|
||||
- Support for external images was improved.
|
||||
|
||||
5.5.013 (2010-07-14)
|
||||
- Bug #3029338 "FI and FO output destination filename bug" was fixed (previous fix was wrong).
|
||||
|
||||
|
@ -8,8 +8,8 @@ http: sourceforge.net/donate/index.php?group_id=128076
|
||||
------------------------------------------------------------
|
||||
|
||||
Name: TCPDF
|
||||
Version: 5.5.013
|
||||
Release date: 2010-07-14
|
||||
Version: 5.5.014
|
||||
Release date: 2010-07-15
|
||||
Author: Nicola Asuni
|
||||
|
||||
Copyright (c) 2002-2010:
|
||||
|
@ -60,7 +60,7 @@
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -1003,7 +1003,7 @@ $code)</code>
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:12 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -5551,7 +5551,7 @@ $frame)</code>
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:12 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -299,7 +299,7 @@ $type)</code>
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -1377,7 +1377,7 @@ $type)</code>
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -105,7 +105,7 @@ PHP class to creates array representations for 2D barcodes to be used with TCPDF
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -105,7 +105,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -542,7 +542,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:22 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -97,7 +97,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:12 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -157,7 +157,7 @@ Class to create PDF417 barcode arrays for TCPDF class.<br /><br /><p>PDF417 (ISO
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:12 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -480,7 +480,7 @@ string $string, [int $split_length = 1])</code>
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:12 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -82,7 +82,7 @@ This is a PHP class for generating PDF documents without requiring external exte
|
||||
<td><b>author:</b> </td><td>Nicola Asuni</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>version:</b> </td><td>5.5.013</td>
|
||||
<td><b>version:</b> </td><td>5.5.014</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>copyright:</b> </td><td>2002-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com</td>
|
||||
@ -113,7 +113,7 @@ unicode data<br /><br /></div>
|
||||
<div class="tags">
|
||||
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
|
||||
<code>PDF_PRODUCER = 'TCPDF 5.5.013 (http://www.tcpdf.org)'</code>
|
||||
<code>PDF_PRODUCER = 'TCPDF 5.5.014 (http://www.tcpdf.org)'</code>
|
||||
</td></tr></table>
|
||||
</td></tr></table>
|
||||
|
||||
@ -124,7 +124,7 @@ unicode data<br /><br /></div>
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:13 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -246,7 +246,7 @@ Unicode data for TCPDF library.<br /><br /><br /><br />
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:22 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -2034,7 +2034,7 @@
|
||||
<a href="elementindex.html#top">top</a><br>
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -2066,7 +2066,7 @@
|
||||
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -35,7 +35,7 @@
|
||||
<a href="#Post-parsing">Post-parsing</a><br>
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:22 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -67,7 +67,7 @@
|
||||
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -67,7 +67,7 @@
|
||||
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 14 Jul 2010 17:50:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Thu, 15 Jul 2010 20:09:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
58
tcpdf.php
58
tcpdf.php
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf.php
|
||||
// Version : 5.5.013
|
||||
// Version : 5.5.014
|
||||
// Begin : 2002-08-03
|
||||
// Last Update : 2010-07-14
|
||||
// Last Update : 2010-07-15
|
||||
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
@ -126,7 +126,7 @@
|
||||
* @copyright 2002-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
|
||||
* @link http://www.tcpdf.org
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL
|
||||
* @version 5.5.013
|
||||
* @version 5.5.014
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -150,14 +150,14 @@ if (!class_exists('TCPDF', false)) {
|
||||
/**
|
||||
* define default PDF document producer
|
||||
*/
|
||||
define('PDF_PRODUCER', 'TCPDF 5.5.013 (http://www.tcpdf.org)');
|
||||
define('PDF_PRODUCER', 'TCPDF 5.5.014 (http://www.tcpdf.org)');
|
||||
|
||||
/**
|
||||
* This is a PHP class for generating PDF documents without requiring external extensions.<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>
|
||||
* @name TCPDF
|
||||
* @package com.tecnick.tcpdf
|
||||
* @version 5.5.013
|
||||
* @version 5.5.014
|
||||
* @author Nicola Asuni - info@tecnick.com
|
||||
* @link http://www.tcpdf.org
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL
|
||||
@ -6413,22 +6413,50 @@ if (!class_exists('TCPDF', false)) {
|
||||
if ($y === '') {
|
||||
$y = $this->y;
|
||||
}
|
||||
$cached_file = false; // true when the file is cached
|
||||
// get image dimensions
|
||||
$imsize = @getimagesize($file);
|
||||
if ($imsize === FALSE) {
|
||||
// encode spaces on filename
|
||||
// try to encode spaces on filename
|
||||
$file = str_replace(' ', '%20', $file);
|
||||
$imsize = @getimagesize($file);
|
||||
if ($imsize === FALSE) {
|
||||
if (($w > 0) AND ($h > 0)) {
|
||||
if (function_exists('curl_init')) {
|
||||
// try to get remote file data using cURL
|
||||
$cs = curl_init(); // curl session
|
||||
curl_setopt($cs, CURLOPT_URL, $file);
|
||||
curl_setopt($cs, CURLOPT_BINARYTRANSFER, true);
|
||||
curl_setopt($cs, CURLOPT_FAILONERROR, true);
|
||||
curl_setopt($cs, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($cs, CURLOPT_CONNECTTIMEOUT, 5);
|
||||
curl_setopt($cs, CURLOPT_TIMEOUT, 30);
|
||||
$imgdata = curl_exec($cs);
|
||||
curl_close($cs);
|
||||
if($imgdata !== FALSE) {
|
||||
// copy image to cache
|
||||
$file = tempnam(K_PATH_CACHE, 'img_');
|
||||
$fp = fopen($file, 'w');
|
||||
fwrite($fp, $imgdata);
|
||||
fclose($fp);
|
||||
unset($imgdata);
|
||||
$cached_file = true;
|
||||
$imsize = @getimagesize($file);
|
||||
if ($imsize === FALSE) {
|
||||
unlink($file);
|
||||
$cached_file = false;
|
||||
}
|
||||
}
|
||||
} elseif (($w > 0) AND ($h > 0)) {
|
||||
// get measures from specified data
|
||||
$pw = $this->getHTMLUnitToUnits($w, 0, $this->pdfunit, true) * $this->imgscale * $this->k;
|
||||
$ph = $this->getHTMLUnitToUnits($h, 0, $this->pdfunit, true) * $this->imgscale * $this->k;
|
||||
$imsize = array($pw, $ph);
|
||||
} else {
|
||||
$this->Error('[Image] Unable to get image width and height: '.$file);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($imsize === FALSE) {
|
||||
$this->Error('[Image] Unable to get image: '.$file);
|
||||
}
|
||||
// get original image width and height in pixels
|
||||
list($pixw, $pixh) = $imsize;
|
||||
// calculate image width and height on document
|
||||
@ -6489,7 +6517,7 @@ if (!class_exists('TCPDF', false)) {
|
||||
// TCPDF image functions
|
||||
$info = $this->$mtd($file);
|
||||
if ($info == 'pngalpha') {
|
||||
return $this->ImagePngAlpha($file, $x, $y, $w, $h, 'PNG', $link, $align, $resize, $dpi, $palign);
|
||||
return $this->ImagePngAlpha($file, $x, $y, $pixw, $pixh, $w, $h, 'PNG', $link, $align, $resize, $dpi, $palign);
|
||||
}
|
||||
}
|
||||
if (!$info) {
|
||||
@ -6586,6 +6614,10 @@ if (!class_exists('TCPDF', false)) {
|
||||
// add image to document
|
||||
$this->setImageBuffer($file, $info);
|
||||
}
|
||||
if ($cached_file) {
|
||||
// remove cached file
|
||||
unlink($file);
|
||||
}
|
||||
// set alignment
|
||||
$this->img_rb_y = $y + $h;
|
||||
// set alignment
|
||||
@ -6907,6 +6939,8 @@ if (!class_exists('TCPDF', false)) {
|
||||
* @param string $file Name of the file containing the image.
|
||||
* @param float $x Abscissa of the upper-left corner.
|
||||
* @param float $y Ordinate of the upper-left corner.
|
||||
* @param float $wpx Original width of the image in pixels.
|
||||
* @param float $hpx original height of the image in pixels.
|
||||
* @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated.
|
||||
* @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated.
|
||||
* @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension.
|
||||
@ -6920,9 +6954,7 @@ if (!class_exists('TCPDF', false)) {
|
||||
* @since 4.3.007 (2008-12-04)
|
||||
* @see Image()
|
||||
*/
|
||||
protected function ImagePngAlpha($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='') {
|
||||
// get image size
|
||||
list($wpx, $hpx) = getimagesize($file);
|
||||
protected function ImagePngAlpha($file, $x, $y, $wpx, $hpx, $w, $h, $type, $link, $align, $resize, $dpi, $palign) {
|
||||
// generate images
|
||||
$img = imagecreatefrompng($file);
|
||||
$imgalpha = imagecreate($wpx, $hpx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user