32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-17 18:45:14 +00:00
This commit is contained in:
nicolaasuni 2010-10-21 11:00:40 +02:00
parent 572ac0cce6
commit f9e28bc725
24 changed files with 359 additions and 304 deletions

View File

@ -1,3 +1,8 @@
5.9.008 (2010-10-21)
- Bug item #3091502 "Bookmark oddity" was fixed.
- HTML internal links now accepts page number and Y position.
- The method write1DBarcode() was improved to accept separate horizontal and vertical padding (see example n. 27).
5.9.007 (2010-10-20) 5.9.007 (2010-10-20)
- Method adjustCellPadding() was fixed to handle bad input. - Method adjustCellPadding() was fixed to handle bad input.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 5.9.007 Version: 5.9.008
Release date: 2010-10-20 Release date: 2010-10-21
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2010: Copyright (c) 2002-2010:

4
cache/utf8test.txt vendored
View File

@ -94,9 +94,11 @@ Hebrew (iw)
Polish (pl) Polish (pl)
----------- -----------
Pchnąć w tę łódź jeża lub ośm skrzyń fig Pchnąć w tę łódź jeża lub osiem skrzyń fig
(= To push a hedgehog or eight bins of figs in this boat) (= To push a hedgehog or eight bins of figs in this boat)
Zażółć gęślą jaźń
Russian (ru) Russian (ru)
------------ ------------

View File

@ -65,7 +65,7 @@
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -1004,7 +1004,7 @@ $code)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -5552,7 +5552,7 @@ $frame)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -300,7 +300,7 @@ $type)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -1378,7 +1378,7 @@ $type)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -18704,7 +18704,7 @@ This is a PHP class containing Unicde data for TCPDF library<br /><br /><br /><b
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:24 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:34 +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

@ -106,7 +106,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 Wed, 20 Oct 2010 09:47:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -106,7 +106,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 Wed, 20 Oct 2010 09:47:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -543,7 +543,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:24 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:34 +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

@ -98,7 +98,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -158,7 +158,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 Wed, 20 Oct 2010 09:47:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -481,7 +481,7 @@ string $string, [int $split_length = 1])</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -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> <td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni</td>
</tr> </tr>
<tr> <tr>
<td><b>version:</b>&nbsp;&nbsp;</td><td>5.9.007</td> <td><b>version:</b>&nbsp;&nbsp;</td><td>5.9.008</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>
@ -112,7 +112,7 @@ main configuration file<br /><br /><p>(define the K_TCPDF_EXTERNAL_CONFIG consta
<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.9.007 (http://www.tcpdf.org)'</code> <code>PDF_PRODUCER = 'TCPDF 5.9.008 (http://www.tcpdf.org)'</code>
</td></tr></table> </td></tr></table>
</td></tr></table> </td></tr></table>
@ -123,7 +123,7 @@ main configuration file<br /><br /><p>(define the K_TCPDF_EXTERNAL_CONFIG consta
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:19 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:30 +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

@ -103,7 +103,7 @@ Unicode data class for TCPDF library.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:24 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:34 +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

@ -2132,7 +2132,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 Wed, 20 Oct 2010 09:47:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -2165,7 +2165,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 Wed, 20 Oct 2010 09:47:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:27 +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

@ -33,13 +33,9 @@
<table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top"> <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">
<a href="#Post-parsing">Post-parsing</a><br> <a href="#Post-parsing">Post-parsing</a><br>
<a name="tcpdf.php"></a>
<h1>tcpdf.php</h1>
<h2>Warnings:</h2><br>
<b>Warning on line 11410</b> - Unknown tag "@seed" used<br>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Wed, 20 Oct 2010 09:47:24 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:34 +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

@ -68,7 +68,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 Wed, 20 Oct 2010 09:47:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +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

@ -68,7 +68,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 Wed, 20 Oct 2010 09:47:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Thu, 21 Oct 2010 11:00:28 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div> </div>
</td></tr></table> </td></tr></table>
</td> </td>

124
tcpdf.php
View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 5.9.007 // Version : 5.9.008
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2010-10-20 // Last Update : 2010-10-21
// 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)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -134,7 +134,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.9.007 * @version 5.9.008
*/ */
/** /**
@ -146,14 +146,14 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php');
/** /**
* define default PDF document producer * define default PDF document producer
*/ */
define('PDF_PRODUCER', 'TCPDF 5.9.007 (http://www.tcpdf.org)'); define('PDF_PRODUCER', 'TCPDF 5.9.008 (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.9.007 * @version 5.9.008
* @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
@ -11274,7 +11274,7 @@ class TCPDF {
/** /**
* Output anchor link. * Output anchor link.
* @param string $url link URL or internal link (i.e.: &lt;a href="#23"&gt;link to page 23&lt;/a&gt;) * @param string $url link URL or internal link (i.e.: &lt;a href="#23,4.5"&gt;link to page 23 at 4.5 Y position&lt;/a&gt;)
* @param string $name link name * @param string $name link name
* @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false).
* @param boolean $firstline if true prints only the first line and return the remaining string. * @param boolean $firstline if true prints only the first line and return the remaining string.
@ -11287,9 +11287,20 @@ class TCPDF {
public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color='', $style=-1, $firstblock=false) { public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color='', $style=-1, $firstblock=false) {
if (!$this->empty_string($url) AND ($url{0} == '#')) { if (!$this->empty_string($url) AND ($url{0} == '#')) {
// convert url to internal link // convert url to internal link
$page = intval(substr($url, 1)); $lnkdata = explode(',', $url);
if (isset($lnkdata[0])) {
$page = intval(substr($lnkdata[0], 1));
if (empty($page) OR ($page <= 0)) {
$page = $this->page;
}
if (isset($lnkdata[1]) AND (strlen($lnkdata[1]) > 0)) {
$lnky = floatval($lnkdata[1]);
} else {
$lnky = 0;
}
$url = $this->AddLink(); $url = $this->AddLink();
$this->SetLink($url, 0, $page); $this->SetLink($url, $lnky, $page);
}
} }
// store current settings // store current settings
$prevcolor = $this->fgcolor; $prevcolor = $this->fgcolor;
@ -11402,7 +11413,7 @@ class TCPDF {
/** /**
* Returns a string containing random data to be used as a seed for encryption methods. * Returns a string containing random data to be used as a seed for encryption methods.
* @seed string starting seed value * @param string $seed starting seed value
* @return string containing random data * @return string containing random data
* @author Nicola Asuni * @author Nicola Asuni
* @since 5.9.006 (2010-10-19) * @since 5.9.006 (2010-10-19)
@ -16557,19 +16568,21 @@ class TCPDF {
* @param int $h height in user units (empty string = remaining page height) * @param int $h height in user units (empty string = remaining page height)
* @param float $xres width of the smallest bar in user units (empty string = default value = 0.4mm) * @param float $xres width of the smallest bar in user units (empty string = default value = 0.4mm)
* @param array $style array of options:<ul> * @param array $style array of options:<ul>
<li>boolean $style['border'] if true prints a border</li> * <li>boolean $style['border'] if true prints a border</li>
<li>int $style['padding'] padding to leave around the barcode (minimum distance between the barcode and the containing cell border) in user units (set to 'auto' for automatic padding)</li> * <li>int $style['padding'] padding to leave around the barcode in user units (set to 'auto' for automatic padding)</li>
<li>array $style['fgcolor'] color array for bars and text</li> * <li>int $style['hpadding'] horizontal padding in user units (set to 'auto' for automatic padding)</li>
<li>mixed $style['bgcolor'] color array for background (set to false for transparent)</li> * <li>int $style['vpadding'] vertical padding in user units (set to 'auto' for automatic padding)</li>
<li>boolean $style['text'] if true prints text below the barcode</li> * <li>array $style['fgcolor'] color array for bars and text</li>
<li>string $style['label'] override default label</li> * <li>mixed $style['bgcolor'] color array for background (set to false for transparent)</li>
<li>string $style['font'] font name for text</li><li>int $style['fontsize'] font size for text</li> * <li>boolean $style['text'] if true prints text below the barcode</li>
<li>int $style['stretchtext']: 0 = disabled; 1 = horizontal scaling only if necessary; 2 = forced horizontal scaling; 3 = character spacing only if necessary; 4 = forced character spacing.</li> * <li>string $style['label'] override default label</li>
<li>string $style['position'] horizontal position of the containing barcode cell on the page: L = left margin; C = center; R = right margin.</li> * <li>string $style['font'] font name for text</li><li>int $style['fontsize'] font size for text</li>
<li>string $style['align'] horizontal position of the barcode on the containing rectangle: L = left; C = center; R = right.</li> * <li>int $style['stretchtext']: 0 = disabled; 1 = horizontal scaling only if necessary; 2 = forced horizontal scaling; 3 = character spacing only if necessary; 4 = forced character spacing.</li>
<li>string $style['stretch'] if true stretch the barcode to best fit the available width, otherwise uses $xres resolution for a single bar.</li> * <li>string $style['position'] horizontal position of the containing barcode cell on the page: L = left margin; C = center; R = right margin.</li>
<li>string $style['fitwidth'] if true reduce the width to fit the barcode width + padding. When this option is enabled the 'stretch' option is automatically disabled.</li> * <li>string $style['align'] horizontal position of the barcode on the containing rectangle: L = left; C = center; R = right.</li>
<li>string $style['cellfitalign'] this option works only when 'fitwidth' is true and 'position' is unset or empty. Set the horizontal position of the containing barcode cell inside the specified rectangle: L = left; C = center; R = right.</li></ul> * <li>string $style['stretch'] if true stretch the barcode to best fit the available width, otherwise uses $xres resolution for a single bar.</li>
* <li>string $style['fitwidth'] if true reduce the width to fit the barcode width + padding. When this option is enabled the 'stretch' option is automatically disabled.</li>
* <li>string $style['cellfitalign'] this option works only when 'fitwidth' is true and 'position' is unset or empty. Set the horizontal position of the containing barcode cell inside the specified rectangle: L = left; C = center; R = right.</li></ul>
* @param string $align Indicates the alignment of the pointer next to barcode insertion relative to barcode 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 barcode insertion relative to barcode 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>
* @author Nicola Asuni * @author Nicola Asuni
* @since 3.1.000 (2008-06-09) * @since 3.1.000 (2008-06-09)
@ -16651,13 +16664,29 @@ class TCPDF {
$w = $this->w - $this->rMargin - $x; $w = $this->w - $this->rMargin - $x;
} }
} }
// horizontal padding // padding
if (!isset($style['padding'])) { if (!isset($style['padding'])) {
$hpadding = 0; $padding = 0;
} elseif ($style['padding'] === 'auto') { } elseif ($style['padding'] === 'auto') {
$hpadding = 5 * ($w / ($arrcode['maxw'] + 10)); $padding = 10 * ($w / ($arrcode['maxw'] + 20));
} else { } else {
$hpadding = $style['padding']; $padding = floatval($style['padding']);
}
// horizontal padding
if (!isset($style['hpadding'])) {
$hpadding = $padding;
} elseif ($style['hpadding'] === 'auto') {
$hpadding = 10 * ($w / ($arrcode['maxw'] + 20));
} else {
$hpadding = floatval($style['hpadding']);
}
// vertical padding
if (!isset($style['vpadding'])) {
$vpadding = $padding;
} elseif ($style['vpadding'] === 'auto') {
$vpadding = ($hpadding / 2);
} else {
$vpadding = floatval($style['vpadding']);
} }
// calculate xres (single bar width) // calculate xres (single bar width)
$max_xres = ($w - (2 * $hpadding)) / $arrcode['maxw']; $max_xres = ($w - (2 * $hpadding)) / $arrcode['maxw'];
@ -16669,10 +16698,14 @@ class TCPDF {
} }
if ($xres > $max_xres) { if ($xres > $max_xres) {
// correct xres to fit on $w // correct xres to fit on $w
$max_xres = $max_xres; $xres = $max_xres;
}
if ((isset($style['padding']) AND ($style['padding'] === 'auto'))
OR (isset($style['hpadding']) AND ($style['hpadding'] === 'auto'))) {
$hpadding = 10 * $xres;
if (isset($style['vpadding']) AND ($style['vpadding'] === 'auto')) {
$vpadding = ($hpadding / 2);
} }
if (isset($style['padding']) AND ($style['padding'] === 'auto')) {
$hpadding = 5 * $xres;
} }
} }
if ($style['fitwidth']) { if ($style['fitwidth']) {
@ -16706,8 +16739,6 @@ class TCPDF {
} }
} }
} }
// vertical padding
$vpadding = $hpadding;
$text_height = ($this->cell_height_ratio * $fontsize / $this->k); $text_height = ($this->cell_height_ratio * $fontsize / $this->k);
// height // height
if (($h === '') OR ($h <= 0)) { if (($h === '') OR ($h <= 0)) {
@ -16911,7 +16942,17 @@ class TCPDF {
* @param int $y y position in user units * @param int $y y position in user units
* @param int $w width in user units * @param int $w width in user units
* @param int $h height in user units * @param int $h height in user units
* @param array $style array of options:<ul><li>boolean $style['border'] if true prints a border around the barcode</li><li>int $style['padding'] padding to leave around the barcode in barcode units (set to 'auto' for automatic padding)</li><li>int $style['hpadding'] horizontal padding in barcode units (set to 'auto' for automatic padding)</li><li>int $style['vpadding'] vertical padding in barcode units (set to 'auto' for automatic padding)</li><li>int $style['module_width'] width of a single module in points</li><li>int $style['module_height'] height of a single module in points</li><li>array $style['fgcolor'] color array for bars and text</li><li>mixed $style['bgcolor'] color array for background or false for transparent</li><li>string $style['position'] barcode position on the page: L = left margin; C = center; R = right margin; S = stretch</li><li>$style['module_width'] width of a single module in points</li><li>$style['module_height'] height of a single module in points</li></ul> * @param array $style array of options:<ul>
* <li>boolean $style['border'] if true prints a border around the barcode</li>
* <li>int $style['padding'] padding to leave around the barcode in barcode units (set to 'auto' for automatic padding)</li>
* <li>int $style['hpadding'] horizontal padding in barcode units (set to 'auto' for automatic padding)</li>
* <li>int $style['vpadding'] vertical padding in barcode units (set to 'auto' for automatic padding)</li>
* <li>int $style['module_width'] width of a single module in points</li>
* <li>int $style['module_height'] height of a single module in points</li>
* <li>array $style['fgcolor'] color array for bars and text</li>
* <li>mixed $style['bgcolor'] color array for background or false for transparent</li>
* <li>string $style['position'] barcode position on the page: L = left margin; C = center; R = right margin; S = stretch</li><li>$style['module_width'] width of a single module in points</li>
* <li>$style['module_height'] height of a single module in points</li></ul>
* @param string $align Indicates the alignment of the pointer next to barcode insertion relative to barcode 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 barcode insertion relative to barcode 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 $distort if true distort the barcode to fit width and height, otherwise preserve aspect ratio * @param boolean $distort if true distort the barcode to fit width and height, otherwise preserve aspect ratio
* @author Nicola Asuni * @author Nicola Asuni
@ -20202,9 +20243,20 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$imglink = $this->HREF['url']; $imglink = $this->HREF['url'];
if ($imglink{0} == '#') { if ($imglink{0} == '#') {
// convert url to internal link // convert url to internal link
$page = intval(substr($imglink, 1)); $lnkdata = explode(',', $imglink);
if (isset($lnkdata[0])) {
$page = intval(substr($lnkdata[0], 1));
if (empty($page) OR ($page <= 0)) {
$page = $this->page;
}
if (isset($lnkdata[1]) AND (strlen($lnkdata[1]) > 0)) {
$lnky = floatval($lnkdata[1]);
} else {
$lnky = 0;
}
$imglink = $this->AddLink(); $imglink = $this->AddLink();
$this->SetLink($imglink, 0, $page); $this->SetLink($imglink, $lnky, $page);
}
} }
} }
$border = 0; $border = 0;
@ -22616,7 +22668,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$this->x += $indent; $this->x += $indent;
} }
$link = $this->AddLink(); $link = $this->AddLink();
$this->SetLink($link, 0, $outline['p']); $this->SetLink($link, $outline['y'], $outline['p']);
// write the text // write the text
$this->Write(0, $outline['t'], $link, 0, $aligntext, false, 0, false, false, 0); $this->Write(0, $outline['t'], $link, 0, $aligntext, false, 0, false, false, 0);
$this->SetFont($numbersfont, $fontstyle, $fontsize); $this->SetFont($numbersfont, $fontstyle, $fontsize);
@ -22755,7 +22807,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$row = str_replace('#TOC_DESCRIPTION#', $outline['t'], $row); $row = str_replace('#TOC_DESCRIPTION#', $outline['t'], $row);
$row = str_replace('#TOC_PAGE_NUMBER#', $pagenum, $row); $row = str_replace('#TOC_PAGE_NUMBER#', $pagenum, $row);
// add link to page // add link to page
$row = '<a href="#'.$outline['p'].'">'.$row.'</a>'; $row = '<a href="#'.$outline['p'].','.$outline['y'].'">'.$row.'</a>';
// write bookmark entry // write bookmark entry
$this->writeHTML($row, false, false, true, false, ''); $this->writeHTML($row, false, false, true, false, '');
} }