30
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-06-06 15:50:47 +00:00
This commit is contained in:
nicolaasuni 2010-10-15 10:47:58 +02:00
parent c91cb496b2
commit bef180b5d5
25 changed files with 1189 additions and 697 deletions

View File

@ -1,3 +1,7 @@
5.9.003 (2010-10-15)
- Support for no-write page regions was added. Check the example n. 64 and new methods setPageRegions(), addPageRegion(), getPageRegions(), removePageRegion().
- A bug on Right-To-Left alignment was fixed.
5.9.002 (2010-10-08)
- Cell method was improved to preserve the font stretching and spacing values when using the $stretch parameter (see example n. 4).

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 5.9.002
Release date: 2010-10-08
Version: 5.9.003
Release date: 2010-10-15
Author: Nicola Asuni
Copyright (c) 2002-2010:
@ -44,16 +44,16 @@ Main Features:
* PDF annotations, including links, text and file attachments;
* text rendering modes (fill, stroke and clipping);
* multiple columns mode;
* no-write page regions;
* bookmarks and table of content;
* text hyphenation;
* text stretching and kerning;
* text stretching and spacing (tracking/kerning);
* automatic page break, line break and text alignments including justification;
* automatic page numbering and page groups;
* move and delete pages;
* page compression (requires php-zlib extension);
* XOBject Templates;
Installation (full instructions on http: www.tcpdf.org):
1. copy the folder on your Web server
2. set your installation path and other parameters on the config/tcpdf_config.php

View File

@ -60,7 +60,7 @@
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1003,7 +1003,7 @@ $code)</code>
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:19 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -5551,7 +5551,7 @@ $frame)</code>
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:19 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 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

@ -299,7 +299,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1377,7 +1377,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -105,7 +105,7 @@ PHP class to creates array representations for 2D barcodes to be used with TCPDF
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -105,7 +105,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -542,7 +542,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:24 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -97,7 +97,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:19 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -157,7 +157,7 @@ Class to create PDF417 barcode arrays for TCPDF class.<br /><br /><p>PDF417 (ISO
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:19 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -480,7 +480,7 @@ string $string, [int $split_length = 1])</code>
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:19 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -74,7 +74,7 @@ Source Location: /tcpdf.php<br /><br />
</div><br /><br />
<h2>Page Details:</h2>
This is a PHP class for generating PDF documents without requiring external extensions.<br /><br /><br /><p>TCPDF project (http://www.tcpdf.org) was originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br /> &lt;h3&gt;TCPDF main features are:&lt;/h3&gt; <ul><li>no external libraries are required for the basic functions;</li><li>all standard page formats, custom page formats, custom margins and units of measure;</li><li>UTF-8 Unicode and Right-To-Left languages;</li><li>TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;</li><li>font subsetting;</li><li>methods to publish some XHTML + CSS code, Javascript and Forms;</li><li>images, graphic (geometric figures) and transformation methods;</li><li>supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html)</li><li>1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, QR-Code, PDF417;</li><li>Grayscale, RGB, CMYK, Spot Colors and Transparencies;</li><li>automatic page header and footer management;</li><li>document encryption and digital signature certifications;</li><li>transactions to UNDO commands;</li><li>PDF annotations, including links, text and file attachments;</li><li>text rendering modes (fill, stroke and clipping);</li><li>multiple columns mode;</li><li>bookmarks and table of content;</li><li>text hyphenation;</li><li>font stretching and spacing (kerning);</li><li>automatic page break, line break and text alignments including justification;</li><li>automatic page numbering and page groups;</li><li>move and delete pages;</li><li>page compression (requires php-zlib extension);</li><li>XOBject Templates;</li></ul> Tools to encode your unicode fonts are on fonts/utils directory.&lt;/p&gt;</p><br /><br /><br />
This is a PHP class for generating PDF documents without requiring external extensions.<br /><br /><br /><p>TCPDF project (http://www.tcpdf.org) was originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br /> &lt;h3&gt;TCPDF main features are:&lt;/h3&gt; <ul><li>no external libraries are required for the basic functions;</li><li>all standard page formats, custom page formats, custom margins and units of measure;</li><li>UTF-8 Unicode and Right-To-Left languages;</li><li>TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;</li><li>font subsetting;</li><li>methods to publish some XHTML + CSS code, Javascript and Forms;</li><li>images, graphic (geometric figures) and transformation methods;</li><li>supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html)</li><li>1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, QR-Code, PDF417;</li><li>Grayscale, RGB, CMYK, Spot Colors and Transparencies;</li><li>automatic page header and footer management;</li><li>document encryption and digital signature certifications;</li><li>transactions to UNDO commands;</li><li>PDF annotations, including links, text and file attachments;</li><li>text rendering modes (fill, stroke and clipping);</li><li>multiple columns mode;</li><li>no-write page regions;</li><li>bookmarks and table of content;</li><li>text hyphenation;</li><li>text stretching and spacing (tracking/kerning);</li><li>automatic page break, line break and text alignments including justification;</li><li>automatic page numbering and page groups;</li><li>move and delete pages;</li><li>page compression (requires php-zlib extension);</li><li>XOBject Templates;</li></ul> Tools to encode your unicode fonts are on fonts/utils directory.&lt;/p&gt;</p><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
@ -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>
</tr>
<tr>
<td><b>version:</b>&nbsp;&nbsp;</td><td>5.9.002</td>
<td><b>version:</b>&nbsp;&nbsp;</td><td>5.9.003</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>
@ -101,19 +101,19 @@ This is a PHP class for generating PDF documents without requiring external exte
<br /><br />
<h4>Includes:</h4>
<div class="tags">
require_once(dirname(__FILE__).'/config/tcpdf_config.php') [line 141]<br />
main configuration file<br /><br />require_once(dirname(__FILE__).'/htmlcolors.php') [line 153]<br />
html colors table<br /><br />require_once(dirname(__FILE__).'/unicode_data.php') [line 148]<br />
require_once(dirname(__FILE__).'/config/tcpdf_config.php') [line 143]<br />
main configuration file<br /><br />require_once(dirname(__FILE__).'/htmlcolors.php') [line 155]<br />
html colors table<br /><br />require_once(dirname(__FILE__).'/unicode_data.php') [line 150]<br />
unicode data<br /><br /></div>
<br /><br />
<br /><br />
<hr />
<a name="definePDF_PRODUCER"></a>
<h3>PDF_PRODUCER <span class="smalllinenumber">[line 159]</span></h3>
<h3>PDF_PRODUCER <span class="smalllinenumber">[line 161]</span></h3>
<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 5.9.002 (http://www.tcpdf.org)'</code>
<code>PDF_PRODUCER = 'TCPDF 5.9.003 (http://www.tcpdf.org)'</code>
</td></tr></table>
</td></tr></table>
@ -124,7 +124,7 @@ unicode data<br /><br /></div>
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:20 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:48 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -246,7 +246,7 @@ Unicode data for TCPDF library.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:24 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -107,6 +107,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodAddLink">TCPDF::AddLink()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.<br /> The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink().</dd>
<dt><b>AddPage</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodAddPage">TCPDF::AddPage()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled).</dd>
<dt><b>addPageRegion</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodaddPageRegion">TCPDF::addPageRegion()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Add a single no-write region on selected page.</dd>
<dt><b>AddSpotColor</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodAddSpotColor">TCPDF::AddSpotColor()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Defines a new spot color.</dd>
<dt><b>addTOC</b></dt>
@ -291,6 +293,8 @@
<dd>in file qrcode.php, method <a href="com-tecnick-tcpdf/QRcode.html#methodcheckModeNum">QRcode::checkModeNum()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;checkModeNum</dd>
<dt><b>checkPageBreak</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodcheckPageBreak">TCPDF::checkPageBreak()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Add page if needed.</dd>
<dt><b>checkPageRegions</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodcheckPageRegions">TCPDF::checkPageRegions()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Check page for no-write regions and adapt current coordinates and page margins if necessary.</dd>
<dt><b>checksum_code39</b></dt>
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodchecksum_code39">TCPDFBarcode::checksum_code39()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Calculate CODE 39 checksum (modulo 43).</dd>
<dt><b>checksum_code93</b></dt>
@ -596,7 +600,7 @@
<dt><b>getCellPaddings</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetCellPaddings">TCPDF::getCellPaddings()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Get the internal Cell padding array.</dd>
<dt><b>GetCharWidth</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodGetCharWidth">TCPDF::GetCharWidth()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns the length of the char in user unit for the current font considering current stretching and kerning.</dd>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodGetCharWidth">TCPDF::GetCharWidth()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns the length of the char in user unit for the current font considering current stretching and spacing (tracking/kerning).</dd>
<dt><b>getCode</b></dt>
<dd>in file qrcode.php, method <a href="com-tecnick-tcpdf/QRcode.html#methodgetCode">QRcode::getCode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Return Reed-Solomon block code.</dd>
<dt><b>getColumn</b></dt>
@ -729,6 +733,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetPageHeight">TCPDF::getPageHeight()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns the page height in units.</dd>
<dt><b>getPageNumGroupAlias</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetPageNumGroupAlias">TCPDF::getPageNumGroupAlias()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Return the alias for the page number on the current page group If the current font is unicode type, the returned string is surrounded by additional curly braces.</dd>
<dt><b>getPageRegions</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetPageRegions">TCPDF::getPageRegions()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Return an array of no-write page regions</dd>
<dt><b>getPageSizeFromFormat</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetPageSizeFromFormat">TCPDF::getPageSizeFromFormat()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Get page dimensions from format name.</dd>
<dt><b>getPageWidth</b></dt>
@ -1187,6 +1193,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$pages">TCPDF::$pages</a></dd>
<dt><b>$page_obj_id</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$page_obj_id">TCPDF::$page_obj_id</a><br>&nbsp;&nbsp;&nbsp;&nbsp;ID of page objects</dd>
<dt><b>$page_regions</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$page_regions">TCPDF::$page_regions</a></dd>
<dt><b>$pdfunit</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$pdfunit">TCPDF::$pdfunit</a></dd>
<dt><b>$PDFVersion</b></dt>
@ -1373,6 +1381,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodregistrationMark">TCPDF::registrationMark()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Paints a registration mark</dd>
<dt><b>RegularPolygon</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodRegularPolygon">TCPDF::RegularPolygon()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Draws a regular polygon.</dd>
<dt><b>removePageRegion</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodremovePageRegion">TCPDF::removePageRegion()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Remove a single no-write region.</dd>
<dt><b>removeSHY</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodremoveSHY">TCPDF::removeSHY()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Removes SHY characters from text.</dd>
<dt><b>replaceBuffer</b></dt>
@ -1625,6 +1635,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetPageMark">TCPDF::setPageMark()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set start-writing mark on current page stream used to put borders and fills.</dd>
<dt><b>setPageOrientation</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetPageOrientation">TCPDF::setPageOrientation()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set page orientation.</dd>
<dt><b>setPageRegions</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetPageRegions">TCPDF::setPageRegions()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set no-write regions on page.</dd>
<dt><b>setPageUnit</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetPageUnit">TCPDF::setPageUnit()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the units of measure for the document.</dd>
<dt><b>setPDFVersion</b></dt>
@ -2094,7 +2106,7 @@
<a href="elementindex.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -307,6 +307,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodAddLink">TCPDF::AddLink()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.<br /> The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink().</dd>
<dt><b>AddPage</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodAddPage">TCPDF::AddPage()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled).</dd>
<dt><b>addPageRegion</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodaddPageRegion">TCPDF::addPageRegion()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Add a single no-write region on selected page.</dd>
<dt><b>AddSpotColor</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodAddSpotColor">TCPDF::AddSpotColor()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Defines a new spot color.</dd>
<dt><b>addTOC</b></dt>
@ -491,6 +493,8 @@
<dd>in file qrcode.php, method <a href="com-tecnick-tcpdf/QRcode.html#methodcheckModeNum">QRcode::checkModeNum()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;checkModeNum</dd>
<dt><b>checkPageBreak</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodcheckPageBreak">TCPDF::checkPageBreak()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Add page if needed.</dd>
<dt><b>checkPageRegions</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodcheckPageRegions">TCPDF::checkPageRegions()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Check page for no-write regions and adapt current coordinates and page margins if necessary.</dd>
<dt><b>checksum_code39</b></dt>
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodchecksum_code39">TCPDFBarcode::checksum_code39()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Calculate CODE 39 checksum (modulo 43).</dd>
<dt><b>checksum_code93</b></dt>
@ -796,7 +800,7 @@
<dt><b>getCellPaddings</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetCellPaddings">TCPDF::getCellPaddings()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Get the internal Cell padding array.</dd>
<dt><b>GetCharWidth</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodGetCharWidth">TCPDF::GetCharWidth()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns the length of the char in user unit for the current font considering current stretching and kerning.</dd>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodGetCharWidth">TCPDF::GetCharWidth()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns the length of the char in user unit for the current font considering current stretching and spacing (tracking/kerning).</dd>
<dt><b>getCode</b></dt>
<dd>in file qrcode.php, method <a href="com-tecnick-tcpdf/QRcode.html#methodgetCode">QRcode::getCode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Return Reed-Solomon block code.</dd>
<dt><b>getColumn</b></dt>
@ -929,6 +933,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetPageHeight">TCPDF::getPageHeight()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Returns the page height in units.</dd>
<dt><b>getPageNumGroupAlias</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetPageNumGroupAlias">TCPDF::getPageNumGroupAlias()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Return the alias for the page number on the current page group If the current font is unicode type, the returned string is surrounded by additional curly braces.</dd>
<dt><b>getPageRegions</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetPageRegions">TCPDF::getPageRegions()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Return an array of no-write page regions</dd>
<dt><b>getPageSizeFromFormat</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetPageSizeFromFormat">TCPDF::getPageSizeFromFormat()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Get page dimensions from format name.</dd>
<dt><b>getPageWidth</b></dt>
@ -1387,6 +1393,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$pages">TCPDF::$pages</a></dd>
<dt><b>$page_obj_id</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$page_obj_id">TCPDF::$page_obj_id</a><br>&nbsp;&nbsp;&nbsp;&nbsp;ID of page objects</dd>
<dt><b>$page_regions</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$page_regions">TCPDF::$page_regions</a></dd>
<dt><b>$pdfunit</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$pdfunit">TCPDF::$pdfunit</a></dd>
<dt><b>$PDFVersion</b></dt>
@ -1573,6 +1581,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodregistrationMark">TCPDF::registrationMark()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Paints a registration mark</dd>
<dt><b>RegularPolygon</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodRegularPolygon">TCPDF::RegularPolygon()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Draws a regular polygon.</dd>
<dt><b>removePageRegion</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodremovePageRegion">TCPDF::removePageRegion()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Remove a single no-write region.</dd>
<dt><b>removeSHY</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodremoveSHY">TCPDF::removeSHY()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Removes SHY characters from text.</dd>
<dt><b>replaceBuffer</b></dt>
@ -1825,6 +1835,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetPageMark">TCPDF::setPageMark()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set start-writing mark on current page stream used to put borders and fills.</dd>
<dt><b>setPageOrientation</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetPageOrientation">TCPDF::setPageOrientation()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set page orientation.</dd>
<dt><b>setPageRegions</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetPageRegions">TCPDF::setPageRegions()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set no-write regions on page.</dd>
<dt><b>setPageUnit</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetPageUnit">TCPDF::setPageUnit()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the units of measure for the document.</dd>
<dt><b>setPDFVersion</b></dt>
@ -2126,7 +2138,7 @@
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Fri, 08 Oct 2010 15:55:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 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, 08 Oct 2010 15:55:24 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -67,7 +67,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, 08 Oct 2010 15:55:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -67,7 +67,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, 08 Oct 2010 15:55:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 15 Oct 2010 10:47:46 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -5,7 +5,7 @@
// Last Update : 2010-10-05
//
// Description : Example 063 for TCPDF class
// Text stretching and spacing (kerning)
// Text stretching and spacing (tracking/kerning)
//
// Author: Nicola Asuni
//
@ -22,7 +22,7 @@
/**
* Creates an example PDF TEST document using TCPDF
* @package com.tecnick.tcpdf
* @abstract TCPDF - Example: Text stretching and spacing (kerning)
* @abstract TCPDF - Example: Text stretching and spacing (tracking/kerning)
* @author Nicola Asuni
* @copyright 2063-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://tcpdf.org
@ -70,12 +70,12 @@ $pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'B', 20);
$pdf->SetFont('helvetica', 'B', 16);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Example of Text Stretching and Spacing (kerning)', '', 0, 'L', true, 0, false, false, 0);
$pdf->Write(0, 'Example of Text Stretching and Spacing (tracking/kerning)', '', 0, 'L', true, 0, false, false, 0);
$pdf->Ln(5);
// create several cells to display all cases of stretching and kerning combinations.

View File

@ -80,7 +80,8 @@ echo '<'.'?'.'xml version="1.0" encoding="UTF-8"'.'?'.'>';
<li>Advanced page settings: [<a href="example_060.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
<li>XHTML + CSS: [<a href="example_061.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
<li>XObject Templates: [<a href="example_062.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
<li>Text stretching and spacing (kerning): [<a href="example_063.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
<li>Text stretching and spacing (tracking/kerning): [<a href="example_063.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
<li>No-write page regions: [<a href="example_064.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
</ol>
</body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 38 KiB

217
tcpdf.php
View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 5.9.002
// Version : 5.9.003
// Begin : 2002-08-03
// Last Update : 2010-10-07
// Last Update : 2010-10-15
// 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)
// -------------------------------------------------------------------
@ -53,9 +53,10 @@
// * PDF annotations, including links, text and file attachments;
// * text rendering modes (fill, stroke and clipping);
// * multiple columns mode;
// * no-write page regions;
// * bookmarks and table of content;
// * text hyphenation;
// * font stretching and spacing (kerning);
// * text stretching and spacing (tracking/kerning);
// * automatic page break, line break and text alignments including justification;
// * automatic page numbering and page groups;
// * move and delete pages;
@ -116,9 +117,10 @@
* <li>PDF annotations, including links, text and file attachments;</li>
* <li>text rendering modes (fill, stroke and clipping);</li>
* <li>multiple columns mode;</li>
* <li>no-write page regions;</li>
* <li>bookmarks and table of content;</li>
* <li>text hyphenation;</li>
* <li>font stretching and spacing (kerning);</li>
* <li>text stretching and spacing (tracking/kerning);</li>
* <li>automatic page break, line break and text alignments including justification;</li>
* <li>automatic page numbering and page groups;</li>
* <li>move and delete pages;</li>
@ -132,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
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @version 5.9.002
* @version 5.9.003
*/
/**
@ -156,14 +158,14 @@ if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
define('PDF_PRODUCER', 'TCPDF 5.9.002 (http://www.tcpdf.org)');
define('PDF_PRODUCER', 'TCPDF 5.9.003 (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 5.9.002
* @version 5.9.003
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@ -1553,12 +1555,20 @@ if (!class_exists('TCPDF', false)) {
protected $font_stretching = 100;
/**
* @var increases or decreases the space between characters in a text by the specified amount (kerning).
* @var increases or decreases the space between characters in a text by the specified amount (tracking/kerning).
* @access protected
* @since 5.9.000 (2010-09-29)
*/
protected $font_spacing = 0;
/**
* @var array of no-write regions
* ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right)
* @access protected
* @since 5.9.003 (2010-10-14)
*/
protected $page_regions = array();
/**
* @var directory used for the last SVG image
* @access protected
@ -4508,7 +4518,7 @@ if (!class_exists('TCPDF', false)) {
}
/**
* Returns the length of the char in user unit for the current font considering current stretching and kerning.
* Returns the length of the char in user unit for the current font considering current stretching and spacing (tracking/kerning).
* @param int $char The char code whose length is to be returned
* @param boolean $notlast set to false for the latest character on string, true otherwise (default)
* @return float char width
@ -5021,6 +5031,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h, $x, $y);
// recalculate coordinates to account for graphic transformations
if (isset($this->transfmatrix) AND !empty($this->transfmatrix)) {
for ($i=$this->transfmatrix_key; $i > 0; --$i) {
@ -5312,6 +5324,8 @@ if (!class_exists('TCPDF', false)) {
$h = $min_cell_height;
}
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h);
$k = $this->k;
if ($this->rtl) {
$x = $this->x - $this->cell_margin['R'];
@ -5944,10 +5958,12 @@ if (!class_exists('TCPDF', false)) {
} else {
$x = $this->GetX();
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions(0, $x, $y);
// apply margins
$oy = $y + $mc_margin['T'];
if ($this->rtl) {
$ox = $x - $mc_margin['R'];
$ox = $this->w - $x - $mc_margin['R'];
} else {
$ox = $x + $mc_margin['L'];
}
@ -5993,7 +6009,7 @@ if (!class_exists('TCPDF', false)) {
while ($maxit > 0) {
$fmid = (($fmax + $fmin) / 2);
$this->SetFontSize($fmid, false);
$this->lasth = $this->FontSize * $this->cell_height_ratio;
$this->resetLastH();
$text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border);
if (($text_height == $maxh) OR (($text_height < $maxh) AND ($fmin >= ($fmax - 0.01)))) {
break;
@ -6438,10 +6454,14 @@ if (!class_exists('TCPDF', false)) {
* @since 1.5
*/
public function Write($h, $txt, $link='', $fill=false, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0, $wadj=0, $margin='') {
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h);
if (strlen($txt) == 0) {
// fix empty text
$txt = ' ';
}
if ($margin === '') {
// set default margins
$margin = $this->cell_margin;
}
// remove carriage returns
@ -6796,6 +6816,7 @@ if (!class_exists('TCPDF', false)) {
* @access protected
*/
protected function getRemainingWidth() {
$this->checkPageRegions();
if ($this->rtl) {
return ($this->x - $this->lMargin);
} else {
@ -7008,6 +7029,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h, $x, $y);
$cached_file = false; // true when the file is cached
// get image dimensions
$imsize = @getimagesize($file);
@ -14360,6 +14383,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h, $x, $y);
if ($js) {
$this->_addfield('text', $name, $x, $y, $w, $h, $prop);
return;
@ -14447,6 +14472,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($w, $x, $y);
if ($js) {
$this->_addfield('radiobutton', $name, $x, $y, $w, $w, $prop);
return;
@ -14537,6 +14564,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h, $x, $y);
if ($js) {
$this->_addfield('listbox', $name, $x, $y, $w, $h, $prop);
$s = '';
@ -14593,6 +14622,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h, $x, $y);
if ($js) {
$this->_addfield('combobox', $name, $x, $y, $w, $h, $prop);
$s = '';
@ -14650,6 +14681,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($w, $x, $y);
if ($js) {
$this->_addfield('checkbox', $name, $x, $y, $w, $w, $prop);
return;
@ -14718,6 +14751,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h, $x, $y);
if ($js) {
$this->_addfield('button', $name, $this->x, $this->y, $w, $h, $prop);
$this->javascript .= 'f'.$name.".buttonSetCaption('".addslashes($caption)."');\n";
@ -16083,6 +16118,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h, $x, $y);
$k = $this->k;
$data = file_get_contents($file);
if ($data === false) {
@ -16438,6 +16475,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h, $x, $y);
if (($w === '') OR ($w <= 0)) {
if ($this->rtl) {
$w = $x - $this->lMargin;
@ -16767,6 +16806,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h, $x, $y);
// number of barcode columns and rows
$rows = $arrcode['num_rows'];
$cols = $arrcode['num_cols'];
@ -17504,7 +17545,7 @@ if (!class_exists('TCPDF', false)) {
/**
* Returns the letter-spacing value from CSS value
* @param string $spacing letter-spacing value
* @param float $parent kerning value of the parent element
* @param float $parent font spacing (tracking/kerning) value of the parent element
* @return float quantity to increases or decreases the space between characters in a text.
* @access protected
* @since 5.9.000 (2010-10-02)
@ -18954,7 +18995,7 @@ if (!class_exists('TCPDF', false)) {
$spacewidth = ($mdiff / ($ns - $no)) * $this->k;
$spacewidthu = -1000 * ($mdiff + (($ns + $no) * $one_space_width)) / $ns / $this->FontSize;
if ($this->font_spacing != 0) {
// fixed kerning mode
// fixed spacing mode
$osw = -1000 * $this->font_spacing / $this->FontSize;
$spacewidthu += $osw;
}
@ -23420,6 +23461,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($h, $x, $y);
$ow = $this->xobjects[$id]['w'];
$oh = $this->xobjects[$id]['h'];
// calculate image width and height on document
@ -23550,7 +23593,7 @@ if (!class_exists('TCPDF', false)) {
/**
* Get the amount to increase or decrease the space between characters in a text.
* @return int kerning value
* @return int font spacing (tracking/kerning) value
* @author Nicola Asuni
* @access public
* @since 5.9.000 (2010-09-29)
@ -23559,6 +23602,150 @@ if (!class_exists('TCPDF', false)) {
return $this->font_spacing;
}
/**
* Return an array of no-write page regions
* @return array of no-write page regions
* @author Nicola Asuni
* @access public
* @since 5.9.003 (2010-10-13)
* @see setPageRegions(), addPageRegion()
*/
public function getPageRegions() {
return $this->page_regions;
}
/**
* Set no-write regions on page.
* A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code.
* A region is always aligned on the left or right side of the page ad is defined using a vertical segment.
* You can set multiple regions for the same page.
* @param array $regions array of no-write regions. For each region you can define an array as follow: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right). Omit this parameter to remove all regions.
* @author Nicola Asuni
* @access public
* @since 5.9.003 (2010-10-13)
* @see addPageRegion(), getPageRegions()
*/
public function setPageRegions($regions=array()) {
// empty current regions array
$this->page_regions = array();
// add regions
foreach ($regions as $data) {
$this->addPageRegion($data);
}
}
/**
* Add a single no-write region on selected page.
* A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code.
* A region is always aligned on the left or right side of the page ad is defined using a vertical segment.
* You can set multiple regions for the same page.
* @param array $region array of a single no-write region array: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right).
* @author Nicola Asuni
* @access public
* @since 5.9.003 (2010-10-13)
* @see setPageRegions(), getPageRegions()
*/
public function addPageRegion($region) {
if (!isset($region['page']) OR empty($region['page'])) {
$region['page'] = $this->page;
}
if (isset($region['xt']) AND isset($region['xb']) AND ($region['xt'] > 0) AND ($region['xb'] > 0)
AND isset($region['yt']) AND isset($region['yb']) AND ($region['yt'] > 0) AND ($region['yt'] < $region['yb'])
AND isset($region['side']) AND (($region['side'] == 'L') OR ($region['side'] == 'R'))) {
$this->page_regions[] = $region;
}
}
/**
* Remove a single no-write region.
* @param int $key region key
* @author Nicola Asuni
* @access public
* @since 5.9.003 (2010-10-13)
* @see setPageRegions(), getPageRegions()
*/
public function removePageRegion($key) {
if (isset($this->page_regions[$key])) {
unset($this->page_regions[$key]);
}
}
/**
* Check page for no-write regions and adapt current coordinates and page margins if necessary.
* A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code.
* A region is always aligned on the left or right side of the page ad is defined using a vertical segment.
* @param float $h height of the text/image/object to print in user units
* @param float $x current X coordinate in user units
* @param float $y current Y coordinate in user units
* @author Nicola Asuni
* @access protected
* @since 5.9.003 (2010-10-13)
*/
protected function checkPageRegions($h=0, &$x='', &$y='') {
// set default values
if ($x === '') {
$x = &$this->x;
}
if ($y === '') {
$y = &$this->y;
}
if (empty($this->page_regions)) {
// no page regions defined
return;
}
if (empty($h)) {
$h = ($this->FontSize * $this->cell_height_ratio) + $this->cell_padding['T'] + $this->cell_padding['B'];
}
if ($this->rtl) {
$this->lMargin = $this->original_lMargin;
} else {
$this->rMargin = $this->original_rMargin;
}
if ($this->AutoPageBreak AND !$this->InFooter AND (($y + $h) > $this->PageBreakTrigger)) {
// the content will be printed on a new page
return;
}
// adjust coordinates and page margins
foreach ($this->page_regions as $regid => $regdata) {
if ($regdata['page'] == $this->page) {
// check region boundaries
if (($y > ($regdata['yt'] - $h)) AND ($y <= $regdata['yb'])) {
// Y is inside the region
$minv = ($regdata['xb'] - $regdata['xt']) / ($regdata['yb'] - $regdata['yt']); // inverse of angular coefficient
$yt = max($y, $regdata['yt']);
$yb = min(($yt + $h), $regdata['yb']);
$xt = (($yt - $regdata['yt']) * $minv) + $regdata['xt'];
$xb = (($yb - $regdata['yt']) * $minv) + $regdata['xt'];
if ($regdata['side'] == 'L') { // left side
$new_margin = max($xt, $xb);
if ($this->lMargin < $new_margin) {
if ($this->rtl) {
// adjust left page margin
$this->lMargin = $new_margin;
}
if ($x < $new_margin) {
// adjust x position
$x = $new_margin;
}
}
} elseif ($regdata['side'] == 'R') { // right side
$new_margin = min($xt, $xb);
if (($this->w - $this->rMargin) > $new_margin) {
if (!$this->rtl) {
// adjust right page margin
$this->rMargin = ($this->w - $new_margin);
}
if ($x > $new_margin) {
// adjust x position
$x = $new_margin;
}
}
}
}
}
}
}
// -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
// SVG METHODS
// -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
@ -23596,6 +23783,8 @@ if (!class_exists('TCPDF', false)) {
if ($y === '') {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
$this->checkPageRegions($x, $y);
$k = $this->k;
$ox = 0;
$oy = 0;