30
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-06-01 05:40:47 +00:00
This commit is contained in:
nicolaasuni 2010-12-04 11:25:49 +01:00
parent d9ecd77c1e
commit 5a37308e1e
24 changed files with 469 additions and 364 deletions

View File

@ -1,3 +1,6 @@
5.9.029 (2010-12-04)
- The $fitbox parameter on Image() method was extended to specify image alignment inside the box (check the example n. 9).
5.9.028 (2010-12-03)
- Font utils makefont.php and makeallttffonts.php were updated.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 5.9.028
Release date: 2010-12-03
Version: 5.9.029
Release date: 2010-12-04
Author: Nicola Asuni
Copyright (c) 2002-2010:

View File

@ -65,7 +65,7 @@
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:24 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1004,7 +1004,7 @@ $code)</code>
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:25 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -5552,7 +5552,7 @@ $frame)</code>
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:25 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +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

@ -300,7 +300,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:24 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1378,7 +1378,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:25 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -18704,7 +18704,7 @@ This is a PHP class containing Unicde data for TCPDF library<br /><br /><br /><b
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:31 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:42 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -106,7 +106,7 @@ PHP class to creates array representations for 2D barcodes to be used with TCPDF
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:24 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -106,7 +106,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:25 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -543,7 +543,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:31 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:42 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -98,7 +98,7 @@ Array of WEB safe colors<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:25 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -158,7 +158,7 @@ Class to create PDF417 barcode arrays for TCPDF class.<br /><br /><p>PDF417 (ISO
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:25 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -481,7 +481,7 @@ string $string, [int $split_length = 1])</code>
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:25 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -83,7 +83,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>5.9.028</td>
<td><b>version:</b>&nbsp;&nbsp;</td><td>5.9.029</td>
</tr>
<tr>
<td><b>copyright:</b>&nbsp;&nbsp;</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>
@ -110,7 +110,7 @@ main configuration file<br /><br /><p>(define the K_TCPDF_EXTERNAL_CONFIG consta
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:26 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:37 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -103,7 +103,7 @@ Unicode data class for TCPDF library.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:31 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:42 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -2144,7 +2144,7 @@
<a href="elementindex.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:24 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -2177,7 +2177,7 @@
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Fri, 03 Dec 2010 15:19:24 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:35 +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 Fri, 03 Dec 2010 15:19:31 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:42 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -68,7 +68,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 Fri, 03 Dec 2010 15:19:24 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -68,7 +68,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 Fri, 03 Dec 2010 15:19:24 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -2,7 +2,7 @@
//============================================================+
// File name : example_009.php
// Begin : 2008-03-04
// Last Update : 2010-11-15
// Last Update : 2010-12-04
//
// Description : Example 009 for TCPDF class
// Test Image
@ -67,7 +67,7 @@ $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// -------------------------------------------------------------------
// add a page
$pdf->AddPage();
@ -75,20 +75,71 @@ $pdf->AddPage();
// set JPEG quality
$pdf->setJPEGQuality(75);
// Image method signature:
// Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Image example
$pdf->Image('../images/image_demo.jpg', 50, 50, 100, 150, 'JPG', 'http://www.tcpdf.org', '', true, 150, '', false, false, 1, false, false, false);
// Example of Image from data stream
// Example of Image from data stream ('PHP rules')
$imgdata = base64_decode('iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABlBMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDrEX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg==');
// The '@' character is used to indicate that follows image data stream and not image file name
// The '@' character is used to indicate that follows an image data stream and not an image file name
$pdf->Image('@'.$imgdata);
// ---------------------------------------------------------
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Image example with resizing
$pdf->Image('../images/image_demo.jpg', 15, 140, 75, 113, 'JPG', 'http://www.tcpdf.org', '', true, 150, '', false, false, 1, false, false, false);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// test fitbox with all alignment combinations
$horizontal_alignments = array('L', 'C', 'R');
$vertical_alignments = array('T', 'M', 'B');
$x = 15;
$y = 35;
$w = 30;
$h = 30;
// test all combinations of alignments
for ($i = 0; $i < 3; ++$i) {
$fitbox = $horizontal_alignments[$i].' ';
$x = 15;
for ($j = 0; $j < 3; ++$j) {
$fitbox{1} = $vertical_alignments[$j];
$pdf->Rect($x, $y, $w, $h, 'F', array(), array(128,255,128));
$pdf->Image('../images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '', '', false, 300, '', false, false, 0, $fitbox, false, false);
$x += 32; // new column
}
$y += 32; // new row
}
$x = 115;
$y = 35;
$w = 25;
$h = 50;
for ($i = 0; $i < 3; ++$i) {
$fitbox = $horizontal_alignments[$i].' ';
$x = 115;
for ($j = 0; $j < 3; ++$j) {
$fitbox{1} = $vertical_alignments[$j];
$pdf->Rect($x, $y, $w, $h, 'F', array(), array(128,255,255));
$pdf->Image('../images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '', '', false, 300, '', false, false, 0, $fitbox, false, false);
$x += 27; // new column
}
$y += 52; // new row
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Stretching, position and alignment example
$pdf->SetXY(110, 200);
$pdf->Image('../images/image_demo.jpg', '', '', 40, 40, '', '', 'T', false, 300, '', false, false, 1, false, false, false);
$pdf->Image('../images/image_demo.jpg', '', '', 40, 40, '', '', '', false, 300, '', false, false, 1, false, false, false);
// -------------------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_009.pdf', 'I');

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 5.9.028
// Version : 5.9.029
// Begin : 2002-08-03
// Last Update : 2010-12-03
// Last Update : 2010-12-04
// 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 @@
* @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.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS.
* @version 5.9.028
* @version 5.9.029
*/
/**
@ -151,7 +151,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>
* @name TCPDF
* @package com.tecnick.tcpdf
* @version 5.9.028
* @version 5.9.029
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @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.
@ -164,7 +164,7 @@ class TCPDF {
* @var current TCPDF version
* @access private
*/
private $tcpdf_version = '5.9.028';
private $tcpdf_version = '5.9.029';
// Protected properties
@ -7119,7 +7119,7 @@ class TCPDF {
* @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 $border Indicates if borders must be drawn around the cell. The value can be 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> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
* @param boolean $fitbox If true scale image dimensions proportionally to fit within the ($w, $h) box.
* @param mixed $fitbox If not false scale image dimensions proportionally to fit within the ($w, $h) box. $fitbox can be true or a 2 characters string indicating the image alignment inside the box. The first character indicate the horizontal alignment (L = left, C = center, R = right) the second character indicate the vertical algnment (T = top, M = middle, B = bottom).
* @param boolean $hidden if true do not display the image.
* @param boolean $fitonpage if true the image is resized to not exceed page dimensions.
* @return image information
@ -7206,12 +7206,63 @@ class TCPDF {
$w = $h * $pixw / $pixh;
} elseif ($h <= 0) {
$h = $w * $pixh / $pixw;
} elseif ($fitbox AND ($w > 0) AND ($h > 0)) {
} elseif (($fitbox !== false) AND ($w > 0) AND ($h > 0)) {
if (strlen($fitbox) !== 2) {
// set default alignment
$fitbox = '--';
}
// scale image dimensions proportionally to fit within the ($w, $h) box
if ((($w * $pixh) / ($h * $pixw)) < 1) {
// store current height
$oldh = $h;
// calculate new height
$h = $w * $pixh / $pixw;
// height difference
$hdiff = ($oldh - $h);
// vertical alignment
switch (strtoupper($fitbox{1})) {
case 'T': {
break;
}
case 'M': {
$y += ($hdiff / 2);
break;
}
case 'B': {
$y += $hdiff;
break;
}
}
} else {
// store current width
$oldw = $w;
// calculate new width
$w = $h * $pixw / $pixh;
// width difference
$wdiff = ($oldw - $w);
// horizontal alignment
switch (strtoupper($fitbox{0})) {
case 'L': {
if ($this->rtl) {
$x -= $wdiff;
}
break;
}
case 'C': {
if ($this->rtl) {
$x -= ($wdiff / 2);
} else {
$x += ($wdiff / 2);
}
break;
}
case 'R': {
if (!$this->rtl) {
$x += $wdiff;
}
break;
}
}
}
}
// fit the image on available space
@ -12735,8 +12786,8 @@ class TCPDF {
/**
* Append a rectangle to the current path as a complete subpath, with lower-left corner (x, y) and dimensions widthand height in user space.
* @param float $x Abscissa of upper-left corner (or upper-right corner for RTL language).
* @param float $y Ordinate of upper-left corner (or upper-right corner for RTL language).
* @param float $x Abscissa of upper-left corner.
* @param float $y Ordinate of upper-left corner.
* @param float $w Width.
* @param float $h Height.
* @param string $op options
@ -12815,8 +12866,8 @@ class TCPDF {
/**
* Draws a rectangle.
* @param float $x Abscissa of upper-left corner (or upper-right corner for RTL language).
* @param float $y Ordinate of upper-left corner (or upper-right corner for RTL language).
* @param float $x Abscissa of upper-left corner.
* @param float $y Ordinate of upper-left corner.
* @param float $w Width.
* @param float $h Height.
* @param string $style Style of rendering. See the getPathPaintOperator() function for more information.