32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-22 21:05:10 +00:00
This commit is contained in:
nicolaasuni 2009-05-18 20:13:19 +02:00
parent f130300b55
commit 751e87d1b8
16 changed files with 44 additions and 35 deletions

View File

@ -1,3 +1,6 @@
4.6.011 (2009-05-18)
- Signature of the Image() method was changed to include the new $fitbox parameter (see source code documentation).
4.6.010 (2009-05-17) 4.6.010 (2009-05-17)
- Image() method was improved: now is possible to specify the maximum dimensions for a constraint box defined by $w and $h parameters, and setting the $resize parameter to null. - Image() method was improved: now is possible to specify the maximum dimensions for a constraint box defined by $w and $h parameters, and setting the $resize parameter to null.
- <tcpdf> tag indent problem was fixed. - <tcpdf> tag indent problem was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 4.6.010 Version: 4.6.011
Release date: 2009-05-17 Release date: 2009-05-18
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2001-2009: Copyright (c) 2001-2009:

View File

@ -45,7 +45,7 @@
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -74,7 +74,7 @@ Source Location: /tcpdf.php<br /><br />
<h4>Version:</h4> <h4>Version:</h4>
<ul> <ul>
<li>4.6.010</li> <li>4.6.011</li>
</ul> </ul>
@ -588,7 +588,7 @@ This is a PHP class for generating PDF documents without requiring external exte
<td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni - info@tecnick.com</td> <td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni - info@tecnick.com</td>
</tr> </tr>
<tr> <tr>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.6.010</td> <td><b>version:</b>&nbsp;&nbsp;</td><td>4.6.011</td>
</tr> </tr>
<tr> <tr>
<td><b>link:</b>&nbsp;&nbsp;</td><td><a href="http://www.tcpdf.org">http://www.tcpdf.org</a></td> <td><b>link:</b>&nbsp;&nbsp;</td><td><a href="http://www.tcpdf.org">http://www.tcpdf.org</a></td>
@ -9343,7 +9343,7 @@ $coords)</code>
</div> </div>
<hr /> <hr />
<a name="methodImage"></a> <a name="methodImage"></a>
<h3>method Image <span class="smalllinenumber">[line 4358]</span></h3> <h3>method Image <span class="smalllinenumber">[line 4359]</span></h3>
<div class="function"> <div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border"> <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"> <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
@ -9356,13 +9356,14 @@ $w = 0], [float
$h = 0], [string $h = 0], [string
$type = ''], [mixed $type = ''], [mixed
$link = ''], [string $link = ''], [string
$align = ''], [mixed $align = ''], [boolean
$resize = false], [int $resize = false], [int
$dpi = 300], [string $dpi = 300], [string
$palign = ''], [boolean $palign = ''], [boolean
$ismask = false], [mixed $ismask = false], [mixed
$imgmask = false], [mixed $imgmask = false], [mixed
$border = 0])</code> $border = 0], [boolean
$fitbox = false])</code>
</td></tr></table> </td></tr></table>
</td></tr></table><br /> </td></tr></table><br />
@ -9428,9 +9429,9 @@ $border = 0])</code>
<td>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></td> <td>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></td>
</tr> </tr>
<tr> <tr>
<td class="type">mixed&nbsp;&nbsp;</td> <td class="type">boolean&nbsp;&nbsp;</td>
<td><b>$resize</b>&nbsp;&nbsp;</td> <td><b>$resize</b>&nbsp;&nbsp;</td>
<td>If false do not resize, if true resize (reduce) the image to fit $w and $h (requires GD library), if null scale image dimensions to fit within the ($w,$h) box proportionally.</td> <td>If true resize (reduce) the image to fit $w and $h (requires GD library).</td>
</tr> </tr>
<tr> <tr>
<td class="type">int&nbsp;&nbsp;</td> <td class="type">int&nbsp;&nbsp;</td>
@ -9456,6 +9457,11 @@ $border = 0])</code>
<td class="type">mixed&nbsp;&nbsp;</td> <td class="type">mixed&nbsp;&nbsp;</td>
<td><b>$border</b>&nbsp;&nbsp;</td> <td><b>$border</b>&nbsp;&nbsp;</td>
<td>Indicates if borders must be drawn around the image. The value can be either a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul>or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul></td> <td>Indicates if borders must be drawn around the image. The value can be either a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul>or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul></td>
</tr>
<tr>
<td class="type">boolean&nbsp;&nbsp;</td>
<td><b>$fitbox</b>&nbsp;&nbsp;</td>
<td>If true scale image dimensions proportionally to fit within the ($w, $h) box.</td>
</tr> </tr>
</table> </table>
</div><br /> </div><br />
@ -19157,7 +19163,7 @@ $file)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:15 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:05 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -1368,7 +1368,7 @@ $type)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -96,7 +96,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -507,7 +507,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:20 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -88,7 +88,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:15 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:05 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </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> <td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni</td>
</tr> </tr>
<tr> <tr>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.6.010</td> <td><b>version:</b>&nbsp;&nbsp;</td><td>4.6.011</td>
</tr> </tr>
<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> <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"> <div class="tags">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border"> <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"> <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>PDF_PRODUCER = 'TCPDF 4.6.010 (http://www.tcpdf.org)'</code> <code>PDF_PRODUCER = 'TCPDF 4.6.011 (http://www.tcpdf.org)'</code>
</td></tr></table> </td></tr></table>
</td></tr></table> </td></tr></table>
@ -115,7 +115,7 @@ unicode data<br /><br /></div>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:15 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:05 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -237,7 +237,7 @@ Unicode Include file for TCPDF.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:20 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -1364,7 +1364,7 @@
<a href="elementindex.html#top">top</a><br> <a href="elementindex.html#top">top</a><br>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -1387,7 +1387,7 @@
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br> <a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -35,7 +35,7 @@
<a href="#Post-parsing">Post-parsing</a><br> <a href="#Post-parsing">Post-parsing</a><br>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:20 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:11 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -58,7 +58,7 @@
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.1</a><br /> This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.1</a><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -58,7 +58,7 @@
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.1</a><br /> This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.1</a><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a> Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -2,9 +2,9 @@
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2009-05-17 // Last Update : 2009-05-18
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org // Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
// Version : 4.6.010 // Version : 4.6.011
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l. // Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l.
@ -126,7 +126,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 * @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 * @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL * @license http://www.gnu.org/copyleft/lesser.html LGPL
* @version 4.6.010 * @version 4.6.011
*/ */
/** /**
@ -150,14 +150,14 @@ if (!class_exists('TCPDF', false)) {
/** /**
* define default PDF document producer * define default PDF document producer
*/ */
define('PDF_PRODUCER', 'TCPDF 4.6.010 (http://www.tcpdf.org)'); define('PDF_PRODUCER', 'TCPDF 4.6.011 (http://www.tcpdf.org)');
/** /**
* This is a PHP class for generating PDF documents without requiring external extensions.<br> * 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> * 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 * @name TCPDF
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @version 4.6.010 * @version 4.6.011
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org * @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL * @license http://www.gnu.org/copyleft/lesser.html LGPL
@ -4345,17 +4345,18 @@ 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 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 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 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 mixed $resize If false do not resize, if true resize (reduce) the image to fit $w and $h (requires GD library), if null scale image dimensions to fit within the ($w,$h) box proportionally. * @param boolean $resize If true resize (reduce) the image to fit $w and $h (requires GD library).
* @param int $dpi dot-per-inch resolution used on resize * @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 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 * @param boolean $ismask true if this image is a mask, false otherwise
* @param mixed $imgmask image object returned by this function or false * @param mixed $imgmask image object returned by this function or false
* @param mixed $border Indicates if borders must be drawn around the image. The value can be either a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul>or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> * @param mixed $border Indicates if borders must be drawn around the image. The value can be either a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul>or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul>
* @param boolean $fitbox If true scale image dimensions proportionally to fit within the ($w, $h) box.
* @return image information * @return image information
* @access public * @access public
* @since 1.1 * @since 1.1
*/ */
public function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0) { public function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false) {
if ($x === '') { if ($x === '') {
$x = $this->x; $x = $this->x;
} }
@ -4383,14 +4384,13 @@ if (!class_exists('TCPDF', false)) {
$w = $h * $pixw / $pixh; $w = $h * $pixw / $pixh;
} elseif ($h <= 0) { } elseif ($h <= 0) {
$h = $w * $pixh / $pixw; $h = $w * $pixh / $pixw;
} elseif (($w > 0) AND ($h > 0) AND is_null($resize)) { } elseif ($fitbox AND ($w > 0) AND ($h > 0)) {
// scale image dimensions to fit within the ($w, $h) box proportionally without resampling the image // scale image dimensions proportionally to fit within the ($w, $h) box
if ($pixw >= $pixh) { if ((($w * $pixh) / ($h * $pixw)) < 1) {
$h = $w * $pixh / $pixw; $h = $w * $pixh / $pixw;
} else { } else {
$w = $h * $pixw / $pixh; $w = $h * $pixw / $pixh;
} }
$resize = false;
} }
// calculate new minimum dimensions in pixels // calculate new minimum dimensions in pixels
$neww = round($w * $this->k * $dpi / $this->dpi); $neww = round($w * $this->k * $dpi / $this->dpi);