30
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-06-05 07:10:48 +00:00
This commit is contained in:
nicolaasuni 2009-12-16 21:18:04 +01:00
parent ee80691065
commit cf6dcf18f1
16 changed files with 275 additions and 254 deletions

View File

@ -1,3 +1,8 @@
4.8.019 (2009-12-16)
- Bug item #2915684 "Image size" was fixed.
- Bug item #2914995 "Image jpeg quality" was fixed.
- The signature of the Image() method was changed (check the documentation for the $resize parameter).
4.8.018 (2009-12-15)
- Bug item #2914352 "write error" was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 4.8.018
Release date: 2009-12-15
Version: 4.8.019
Release date: 2009-12-16
Author: Nicola Asuni
Copyright (c) 2001-2009:

View File

@ -45,7 +45,7 @@
<div class="credit">
<hr />
Documentation generated on Tue, 15 Dec 2009 19:00:47 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:51 +0100 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

View File

@ -1368,7 +1368,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Tue, 15 Dec 2009 19:00:47 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:51 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -96,7 +96,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
<div class="credit">
<hr />
Documentation generated on Tue, 15 Dec 2009 19:00:47 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:51 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -507,7 +507,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Tue, 15 Dec 2009 19:00:53 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:57 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -88,7 +88,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Tue, 15 Dec 2009 19:00:48 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:52 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -73,7 +73,7 @@ This is a PHP class for generating PDF documents without requiring external exte
<td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni</td>
</tr>
<tr>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.8.018</td>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.8.019</td>
</tr>
<tr>
<td><b>copyright:</b>&nbsp;&nbsp;</td><td>2002-2009 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>
@ -104,7 +104,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 4.8.018 (http://www.tcpdf.org)'</code>
<code>PDF_PRODUCER = 'TCPDF 4.8.019 (http://www.tcpdf.org)'</code>
</td></tr></table>
</td></tr></table>
@ -115,7 +115,7 @@ unicode data<br /><br /></div>
<div class="credit">
<hr />
Documentation generated on Tue, 15 Dec 2009 19:00:48 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:52 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -237,7 +237,7 @@ Unicode Include file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Tue, 15 Dec 2009 19:00:53 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:57 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1040,7 +1040,7 @@
<dt><b>setImageScale</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetImageScale">TCPDF::setImageScale()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the adjusting factor to convert pixels to user units.</dd>
<dt><b>setImageSubBuffer</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetImageSubBuffer">TCPDF::setImageSubBuffer()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set image buffer content.</dd>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetImageSubBuffer">TCPDF::setImageSubBuffer()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set image buffer content for a specified sub-key.</dd>
<dt><b>setJPEGQuality</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetJPEGQuality">TCPDF::setJPEGQuality()</a></dd>
<dt><b>SetKeywords</b></dt>
@ -1448,7 +1448,7 @@
<a href="elementindex.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Tue, 15 Dec 2009 19:00:47 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:51 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1199,7 +1199,7 @@
<dt><b>setImageScale</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetImageScale">TCPDF::setImageScale()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the adjusting factor to convert pixels to user units.</dd>
<dt><b>setImageSubBuffer</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetImageSubBuffer">TCPDF::setImageSubBuffer()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set image buffer content.</dd>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetImageSubBuffer">TCPDF::setImageSubBuffer()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set image buffer content for a specified sub-key.</dd>
<dt><b>setJPEGQuality</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetJPEGQuality">TCPDF::setJPEGQuality()</a></dd>
<dt><b>SetKeywords</b></dt>
@ -1471,7 +1471,7 @@
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Tue, 15 Dec 2009 19:00:47 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:51 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -35,7 +35,7 @@
<a href="#Post-parsing">Post-parsing</a><br>
<div class="credit">
<hr />
Documentation generated on Tue, 15 Dec 2009 19:00:53 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:57 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -58,7 +58,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 Tue, 15 Dec 2009 19:00:47 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:51 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -58,7 +58,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 Tue, 15 Dec 2009 19:00:47 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Wed, 16 Dec 2009 21:17:51 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -2,9 +2,9 @@
//============================================================+
// File name : tcpdf.php
// Begin : 2002-08-03
// Last Update : 2009-12-15
// Last Update : 2009-12-16
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
// Version : 4.8.018
// Version : 4.8.019
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// ----------------------------------------------------------------------------
// Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l.
@ -128,7 +128,7 @@
* @copyright 2002-2009 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 4.8.018
* @version 4.8.019
*/
/**
@ -152,14 +152,14 @@ if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
define('PDF_PRODUCER', 'TCPDF 4.8.018 (http://www.tcpdf.org)');
define('PDF_PRODUCER', 'TCPDF 4.8.019 (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 4.8.018
* @version 4.8.019
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@ -4704,7 +4704,7 @@ if (!class_exists('TCPDF', false)) {
* @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.
* @param mixed $link URL or identifier returned by AddLink().
* @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:<ul><li>T: top-right for LTR or top-left for RTL</li><li>M: middle-right for LTR or middle-left for RTL</li><li>B: bottom-right for LTR or bottom-left for RTL</li><li>N: next line</li></ul>
* @param boolean $resize If true resize (reduce) the image to fit $w and $h (requires GD library).
* @param mixed $resize If true resize (reduce) the image to fit $w and $h (requires GD or ImageMagick library); if false do not resize; if 2 force resize in all cases (upscaling and downscaling).
* @param int $dpi dot-per-inch resolution used on resize
* @param string $palign Allows to center or align the image on the current line. Possible values are:<ul><li>L : left align</li><li>C : center</li><li>R : right align</li><li>'' : empty string : left for LTR or right for RTL</li></ul>
* @param boolean $ismask true if this image is a mask, false otherwise
@ -4756,11 +4756,26 @@ if (!class_exists('TCPDF', false)) {
$neww = round($w * $this->k * $dpi / $this->dpi);
$newh = round($h * $this->k * $dpi / $this->dpi);
// check if resize is necessary (resize is used only to reduce the image)
if (($neww * $newh) >= ($pixw * $pixh)) {
$newsize = ($neww * $newh);
$pixsize = ($pixw * $pixh);
if (intval($resize) == 2) {
$resize = true;
} elseif ($newsize >= $pixsize) {
$resize = false;
}
// check if image has been already added on document
if (!in_array($file, $this->imagekeys)) {
$newimage = true;
if (in_array($file, $this->imagekeys)) {
$newimage = false;
// get existing image data
$info = $this->getImageBuffer($file);
// check if the newer image is larger
$oldsize = ($info['w'] * $info['h']);
if ((($oldsize < $newsize) AND ($resize)) OR (($oldsize < $pixsize) AND (!$resize))) {
$newimage = true;
}
}
if ($newimage) {
//First use of image, get info
if ($type == '') {
$type = $this->getImageFileType($file);
@ -4817,14 +4832,15 @@ if (!class_exists('TCPDF', false)) {
// force grayscale
$info['cs'] = 'DeviceGray';
}
$info['i'] = $this->numimages + 1;
$info['i'] = $this->numimages;
if (!in_array($file, $this->imagekeys)) {
++$info['i'];
}
if ($imgmask !== false) {
$info['masked'] = $imgmask;
}
// add image to document
$this->setImageBuffer($file, $info);
} else {
$info = $this->getImageBuffer($file);
}
// Check whether we need a new page first as this does not fit
$prev_x = $this->x;
@ -15637,12 +15653,12 @@ if (!class_exists('TCPDF', false)) {
}
if (!in_array($image, $this->imagekeys)) {
$this->imagekeys[] = $image;
++$this->numimages;
}
++$this->numimages;
}
/**
* Set image buffer content.
* Set image buffer content for a specified sub-key.
* @param string $image image key
* @param string $key image sub-key
* @param array $data image data