32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-12-02 00:53:53 +00:00
This commit is contained in:
nicolaasuni 2010-07-02 13:06:27 +02:00
parent b5a2d41111
commit cc6a31a31c
23 changed files with 437 additions and 349 deletions

View File

@ -1,3 +1,8 @@
5.5.007 (2010-07-02)
- Attribute "readonly" was added to input and textarea form fields.
- Vertical alignment feature was added on MultiCell() method only for simple text mode (see example n. 5).
- Text-Fit feature was added on MultiCell() method only for simple text mode (see example n. 5).
5.5.006 (2010-06-29) 5.5.006 (2010-06-29)
- getStringHeight() and getNumLines() methods were fixed. - getStringHeight() and getNumLines() methods were fixed.

View File

@ -8,8 +8,8 @@ http: sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 5.5.006 Version: 5.5.007
Release date: 2010-06-29 Release date: 2010-07-02
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2010: Copyright (c) 2002-2010:

View File

@ -60,7 +60,7 @@
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -1003,7 +1003,7 @@ $code)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -5551,7 +5551,7 @@ $frame)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

File diff suppressed because it is too large Load Diff

View File

@ -299,7 +299,7 @@ $type)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -1377,7 +1377,7 @@ $type)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -105,7 +105,7 @@ PHP class to creates array representations for 2D barcodes to be used with TCPDF
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -105,7 +105,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 Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -542,7 +542,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:58 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:22 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -97,7 +97,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -157,7 +157,7 @@ Class to create PDF417 barcode arrays for TCPDF class.<br /><br /><p>PDF417 (ISO
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -480,7 +480,7 @@ string $string, [int $split_length = 1])</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -82,7 +82,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>5.5.006</td> <td><b>version:</b>&nbsp;&nbsp;</td><td>5.5.007</td>
</tr> </tr>
<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> <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>
@ -113,7 +113,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 5.5.006 (http://www.tcpdf.org)'</code> <code>PDF_PRODUCER = 'TCPDF 5.5.007 (http://www.tcpdf.org)'</code>
</td></tr></table> </td></tr></table>
</td></tr></table> </td></tr></table>
@ -124,7 +124,7 @@ unicode data<br /><br /></div>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:53 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -246,7 +246,7 @@ Unicode data for TCPDF library.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:58 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:22 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -2026,7 +2026,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 Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -2058,7 +2058,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 Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</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 Tue, 29 Jun 2010 12:22:58 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:22 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -67,7 +67,7 @@
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br /> This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -67,7 +67,7 @@
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br /> This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 29 Jun 2010 12:22:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Fri, 02 Jul 2010 13:06:16 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

View File

@ -2,7 +2,7 @@
//============================================================+ //============================================================+
// File name : example_005.php // File name : example_005.php
// Begin : 2008-03-04 // Begin : 2008-03-04
// Last Update : 2010-05-20 // Last Update : 2010-07-02
// //
// Description : Example 005 for TCPDF class // Description : Example 005 for TCPDF class
// Multicell // Multicell
@ -90,6 +90,18 @@ $pdf->MultiCell(55, 5, '[CENTER] '.$txt, 1, 'C', 0, 0, '', '', true);
$pdf->MultiCell(55, 5, '[JUSTIFY] '.$txt."\n", 1, 'J', 1, 2, '' ,'', true); $pdf->MultiCell(55, 5, '[JUSTIFY] '.$txt."\n", 1, 'J', 1, 2, '' ,'', true);
$pdf->MultiCell(55, 5, '[DEFAULT] '.$txt, 1, '', 0, 1, '', '', true); $pdf->MultiCell(55, 5, '[DEFAULT] '.$txt, 1, '', 0, 1, '', '', true);
$pdf->Ln(4);
// set color for background
$pdf->SetFillColor(220, 255, 220);
// Vertical alignment
$pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - TOP] '.$txt, 1, 'J', 1, 0, '', '', true, 0, false, true, 40, 'T');
$pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - MIDDLE] '.$txt, 1, 'J', 1, 0, '', '', true, 0, false, true, 40, 'M');
$pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - BOTTOM] '.$txt, 1, 'J', 1, 1, '', '', true, 0, false, true, 40, 'B');
$pdf->Ln(4);
// set color for background // set color for background
$pdf->SetFillColor(215, 235, 255); $pdf->SetFillColor(215, 235, 255);
@ -101,6 +113,12 @@ Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi,
// print a blox of text using multicell() // print a blox of text using multicell()
$pdf->MultiCell(80, 5, $txt."\n", 1, 'J', 1, 1, '' ,'', true); $pdf->MultiCell(80, 5, $txt."\n", 1, 'J', 1, 1, '' ,'', true);
// set color for background
$pdf->SetFillColor(255, 235, 235);
// Fit text on cell by reducing font size
$pdf->MultiCell(55, 60, '[FIT CELL] '.$txt."\n", 1, 'J', 1, 1, 125, 135, true, 0, false, true, 60, 'M', true);
// move pointer to last page // move pointer to last page
$pdf->lastPage(); $pdf->lastPage();

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 5.5.006 // Version : 5.5.007
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2010-06-29 // Last Update : 2010-07-02
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com // 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) // 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 * @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 * @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL * @license http://www.gnu.org/copyleft/lesser.html LGPL
* @version 5.5.006 * @version 5.5.007
*/ */
/** /**
@ -150,14 +150,14 @@ if (!class_exists('TCPDF', false)) {
/** /**
* define default PDF document producer * define default PDF document producer
*/ */
define('PDF_PRODUCER', 'TCPDF 5.5.006 (http://www.tcpdf.org)'); define('PDF_PRODUCER', 'TCPDF 5.5.007 (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 5.5.006 * @version 5.5.007
* @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
@ -4535,11 +4535,12 @@ if (!class_exists('TCPDF', false)) {
/** /**
* Defines the size of the current font. * Defines the size of the current font.
* @param float $size The size (in points) * @param float $size The size (in points)
* @param boolean $out if true output the font size command, otherwise only set the font properties.
* @access public * @access public
* @since 1.0 * @since 1.0
* @see SetFont() * @see SetFont()
*/ */
public function SetFontSize($size) { public function SetFontSize($size, $out=true) {
//Set font size in points //Set font size in points
$this->FontSizePt = $size; $this->FontSizePt = $size;
$this->FontSize = $size / $this->k; $this->FontSize = $size / $this->k;
@ -4553,7 +4554,7 @@ if (!class_exists('TCPDF', false)) {
} else { } else {
$this->FontDescent = 0.15 * $this->FontSize; $this->FontDescent = 0.15 * $this->FontSize;
} }
if (($this->page > 0) AND (isset($this->CurrentFont['i']))) { if ($out AND ($this->page > 0) AND (isset($this->CurrentFont['i']))) {
$this->_out(sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt)); $this->_out(sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
} }
} }
@ -5362,12 +5363,14 @@ if (!class_exists('TCPDF', false)) {
* @param boolean $ishtml set to true if $txt is HTML content (default = false). * @param boolean $ishtml set to true if $txt is HTML content (default = false).
* @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width. * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width.
* @param float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false. * @param float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false.
* @param string $valign Vertical alignment of text (requires $maxh = $h > 0). Possible values are:<ul><li>T: TOP</li><li>M: middle</li><li>B: bottom</li></ul>. This feature works only when $ishtml=false.
* @param boolean $fitcell if true attempt to fit all the text within the cell by reducing the font size.
* @return int Return the number of cells or 1 for html mode. * @return int Return the number of cells or 1 for html mode.
* @access public * @access public
* @since 1.3 * @since 1.3
* @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak() * @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak()
*/ */
public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0) { public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0, $valign='T', $fitcell=false) {
if ($this->empty_string($this->lasth) OR $reseth) { if ($this->empty_string($this->lasth) OR $reseth) {
//set row height //set row height
$this->lasth = $this->FontSize * $this->cell_height_ratio; $this->lasth = $this->FontSize * $this->cell_height_ratio;
@ -5421,13 +5424,51 @@ if (!class_exists('TCPDF', false)) {
// add top padding // add top padding
$this->y += $this->cMargin; $this->y += $this->cMargin;
} }
if ($ishtml) { if ($ishtml) { // ******* Write HTML text
// ******* Write HTML text
$this->writeHTML($txt, true, 0, $reseth, true, $align); $this->writeHTML($txt, true, 0, $reseth, true, $align);
$nl = 1; $nl = 1;
} else { // ******* Write simple text
// vertical alignment
if ($maxh > 0) {
// get text height
$text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, '', '');
if ($fitcell) {
$prev_FontSizePt = $this->FontSizePt;
// try to reduce font size to fit text on cell (use a quick search algorithm)
$fmin = 1;
$fmax = $this->FontSizePt;
$prev_text_height = $text_height;
$maxit = 100; // max number of iterations
while ($maxit > 0) {
$fmid = (($fmax + $fmin) / 2);
$this->SetFontSize($fmid, false);
$text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, '', '');
if (($text_height == $maxh) OR (($text_height < $maxh) AND ($fmin >= ($fmax - 0.01)))) {
break;
} elseif ($text_height < $maxh) {
$fmin = $fmid;
} else { } else {
// ******* Write text $fmax = $fmid;
}
--$maxit;
}
$this->SetFontSize($this->FontSizePt);
}
if ($text_height < $maxh) {
if ($valign == 'M') {
// text vertically aligned on middle
$this->y += (($maxh - $text_height) / 2);
} elseif ($valign == 'B') {
// text vertically aligned on bottom
$this->y += ($maxh - $text_height);
}
}
}
$nl = $this->Write($this->lasth, $txt, '', 0, $align, true, $stretch, false, true, $maxh); $nl = $this->Write($this->lasth, $txt, '', 0, $align, true, $stretch, false, true, $maxh);
if ($fitcell) {
// restore font size
$this->SetFontSize($prev_FontSizePt);
}
} }
if ($autopadding) { if ($autopadding) {
// add bottom padding // add bottom padding
@ -5690,7 +5731,7 @@ if (!class_exists('TCPDF', false)) {
/** /**
* This method return the estimated needed height for print a simple text string in Multicell() method. * This method return the estimated needed height for print a simple text string in Multicell() method.
* Generally, if you want to know the exact height for a block of content you can use the following technique: * Generally, if you want to know the exact height for a block of content you can use the following alternative technique:
* <pre> * <pre>
* // store current object * // store current object
* $pdf->startTransaction(); * $pdf->startTransaction();
@ -5807,8 +5848,8 @@ if (!class_exists('TCPDF', false)) {
// widht for SHY replacement // widht for SHY replacement
$shy_replacement_width = $this->GetCharWidth($shy_replacement); $shy_replacement_width = $this->GetCharWidth($shy_replacement);
// store current position // store current position
$prevx = $this->x; //$prevx = $this->x;
$prevy = $this->y; //$prevy = $this->y;
// max Y // max Y
$maxy = $this->y + $maxh - $h - (2 * $this->cMargin); $maxy = $this->y + $maxh - $h - (2 * $this->cMargin);
// calculate remaining line width ($w) // calculate remaining line width ($w)
@ -16426,7 +16467,7 @@ if (!class_exists('TCPDF', false)) {
// define block tags // define block tags
$blocktags = array('blockquote','br','dd','dl','div','dt','h1','h2','h3','h4','h5','h6','hr','li','ol','p','pre','ul','tcpdf','table','tr','td'); $blocktags = array('blockquote','br','dd','dl','div','dt','h1','h2','h3','h4','h5','h6','hr','li','ol','p','pre','ul','tcpdf','table','tr','td');
// remove all unsupported tags (the line below lists all supported tags) // remove all unsupported tags (the line below lists all supported tags)
$html = strip_tags($html, '<marker/><a><b><blockquote><body><br><br/><dd><del><div><dl><dt><em><font><form><h1><h2><h3><h4><h5><h6><hr><i><img><input><label><li><ol><option><p><pre><select><small><span><strong><sub><sup><table><tablehead><tcpdf><td><textarea><th><thead><tr><tt><u><ul>'); $html = strip_tags($html, '<marker/><a><b><blockquote><body><br><br/><dd><del><div><dl><dt><em><font><form><h1><h2><h3><h4><h5><h6><hr><hr/><i><img><input><label><li><ol><option><p><pre><select><small><span><strong><sub><sup><table><tablehead><tcpdf><td><textarea><th><thead><tr><tt><u><ul>');
//replace some blank characters //replace some blank characters
$html = preg_replace('/<pre/', '<xre', $html); // preserve pre tag $html = preg_replace('/<pre/', '<xre', $html); // preserve pre tag
$html = preg_replace('/<(table|tr|td|th|tcpdf|blockquote|dd|div|dl|dt|form|h1|h2|h3|h4|h5|h6|br|hr|li|ol|ul|p)([^\>]*)>[\n\r\t]+/', '<\\1\\2>', $html); $html = preg_replace('/<(table|tr|td|th|tcpdf|blockquote|dd|div|dl|dt|form|h1|h2|h3|h4|h5|h6|br|hr|li|ol|ul|p)([^\>]*)>[\n\r\t]+/', '<\\1\\2>', $html);
@ -18583,6 +18624,9 @@ if (!class_exists('TCPDF', false)) {
} }
$prop = array(); $prop = array();
$opt = array(); $opt = array();
if (isset($tag['attribute']['readonly']) AND !$this->empty_string($tag['attribute']['readonly'])) {
$prop['readonly'] = true;
}
if (isset($tag['attribute']['value']) AND !$this->empty_string($tag['attribute']['value'])) { if (isset($tag['attribute']['value']) AND !$this->empty_string($tag['attribute']['value'])) {
$value = $tag['attribute']['value']; $value = $tag['attribute']['value'];
} }
@ -18703,6 +18747,9 @@ if (!class_exists('TCPDF', false)) {
case 'textarea': { case 'textarea': {
$prop = array(); $prop = array();
$opt = array(); $opt = array();
if (isset($tag['attribute']['readonly']) AND !$this->empty_string($tag['attribute']['readonly'])) {
$prop['readonly'] = true;
}
if (isset($tag['attribute']['name']) AND !$this->empty_string($tag['attribute']['name'])) { if (isset($tag['attribute']['name']) AND !$this->empty_string($tag['attribute']['name'])) {
$name = $tag['attribute']['name']; $name = $tag['attribute']['name'];
} else { } else {