32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-26 06:17:33 +00:00
This commit is contained in:
nicolaasuni 2010-04-07 10:01:04 +02:00
parent ce2dca7465
commit 13a3ef412d
21 changed files with 737 additions and 671 deletions

View File

@ -1,3 +1,6 @@
4.9.011 (2010-04-07)
- Vertical alignments for Cell() method were improved (see example n. 57).
4.9.010 (2010-04-06) 4.9.010 (2010-04-06)
- Signature of Cell() method now includes a new parameters for vertical alignment (see example n. 57). - Signature of Cell() method now includes a new parameters for vertical alignment (see example n. 57).
- Text() method was extended to include all Cell() parameters. - Text() method was extended to include all Cell() parameters.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 4.9.010 Version: 4.9.011
Release date: 2010-04-06 Release date: 2010-04-07
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2001-2010: Copyright (c) 2001-2010:
@ -29,32 +29,28 @@ Description:
TCPDF has been originally derived from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org). TCPDF has been originally derived from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org).
Main Features: Main Features:
// * no external libraries are required for the basic functions; // * no external libraries are required for the basic functions;
// * supports all ISO page formats; // * all ISO page formats, custom page formats, custom margins and units of measure;
// * supports custom page formats, margins and units of measure; // * UTF-8 Unicode and Right-To-Left languages;
// * supports UTF-8 Unicode and Right-To-Left languages; // * TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;
// * supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts; // * methods to publish some XHTML code, Javascript and Forms;
// * supports document encryption; // * images, graphic (geometric figures) and transformation methods;
// * includes methods to publish some XHTML code, including forms; // * supports JPEG and PNG 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)
// * includes graphic (geometric) and transformation methods; // * 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;
// * includes Javascript and Forms support; // * Grayscale, RGB, CMYK, Spot Colors and Transparencies;
// * includes a method to print various barcode formats: 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; // * automatic page header and footer management;
// * includes methods to set Bookmarks and print a Table of Content; // * document encryption and digital signature certifications;
// * includes methods to move and delete pages; // * transactions to UNDO commands;
// * includes methods for automatic page header and footer management; // * PDF annotations, including links, text and file attachments;
// * supports multi-column mode; // * text rendering modes (fill, stroke and clipping);
// * supports automatic page break; // * multiple columns mode;
// * supports automatic page numbering and page groups; // * bookmarks and table of content;
// * supports automatic line break and text justification; // * text hyphenation;
// * supports JPEG and PNG 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) // * automatic page break, line break and text alignments including justification;
// * supports stroke and clipping mode for text; // * automatic page numbering and page groups;
// * supports clipping masks; // * move and delete pages;
// * supports Grayscale, RGB, CMYK, Spot Colors and Transparencies; // * page compression (requires php-zlib extension);
// * supports several annotations, including links, text and file attachments;
// * supports page compression (requires zlib extension);
// * supports text hyphenation.
// * supports transactions to UNDO commands.
// * supports signature certifications.
Installation (full instructions on http://www.tcpdf.org): Installation (full instructions on http://www.tcpdf.org):
1. copy the folder on your Web server 1. copy the folder on your Web server

View File

@ -55,7 +55,7 @@
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 06 Apr 2010 19:44:37 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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

@ -5548,7 +5548,7 @@ $frame)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 06 Apr 2010 19:44:38 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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

@ -296,7 +296,7 @@ $type)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 06 Apr 2010 19:44:37 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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

@ -1374,7 +1374,7 @@ $type)</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 06 Apr 2010 19:44:37 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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

@ -102,7 +102,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, 06 Apr 2010 19:44:37 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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

@ -102,7 +102,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, 06 Apr 2010 19:44:37 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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

@ -539,7 +539,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 06 Apr 2010 19:44:41 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:58 +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

@ -94,7 +94,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 06 Apr 2010 19:44:38 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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

@ -477,7 +477,7 @@ string $string, [int $split_length = 1])</code>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 06 Apr 2010 19:44:38 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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

@ -71,7 +71,7 @@ Source Location: /tcpdf.php<br /><br />
</div><br /><br /> </div><br /><br />
<h2>Page Details:</h2> <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>supports all ISO page formats;</li><li>supports custom page formats, margins and units of measure;</li><li>supports UTF-8 Unicode and Right-To-Left languages;</li><li>supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;</li><li>supports document encryption;</li><li>includes methods to publish some XHTML code, including forms;</li><li>includes graphic (geometric) and transformation methods;</li><li>includes Javascript and Forms support;</li><li>includes a method to print various barcode formats: 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</li><li>includes methods to set Bookmarks and print a Table of Content;</li><li>includes methods to move and delete pages;</li><li>includes methods for automatic page header and footer management;</li><li>supports multi-column mode;</li><li>supports automatic page break;</li><li>supports automatic page numbering and page groups;</li><li>supports automatic line break and text justification;</li><li>supports JPEG and PNG 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>supports stroke and clipping mode for text;</li><li>supports clipping masks;</li><li>supports Grayscale, RGB, CMYK, Spot Colors and Transparencies;</li><li>supports several annotations, including links, text and file attachments;</li><li>supports page compression (requires zlib extension);</li><li>supports text hyphenation.</li><li>supports transactions to UNDO commands.</li><li>supports signature certifications.</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 ISO 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>methods to publish some XHTML code, Javascript and Forms;</li><li>images, graphic (geometric figures) and transformation methods;</li><li>supports JPEG and PNG 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;</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>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></ul> Tools to encode your unicode fonts are on fonts/utils directory.&lt;/p&gt;</p><br /><br /><br />
<h4>Tags:</h4> <h4>Tags:</h4>
<div class="tags"> <div class="tags">
<table border="0" cellspacing="0" cellpadding="0"> <table border="0" cellspacing="0" cellpadding="0">
@ -79,7 +79,7 @@ This is a PHP class for generating PDF documents without requiring external exte
<td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni</td> <td><b>author:</b>&nbsp;&nbsp;</td><td>Nicola Asuni</td>
</tr> </tr>
<tr> <tr>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.9.010</td> <td><b>version:</b>&nbsp;&nbsp;</td><td>4.9.011</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>
@ -98,19 +98,19 @@ This is a PHP class for generating PDF documents without requiring external exte
<br /><br /> <br /><br />
<h4>Includes:</h4> <h4>Includes:</h4>
<div class="tags"> <div class="tags">
require_once(dirname(__FILE__).'/config/tcpdf_config.php') [line 140]<br /> require_once(dirname(__FILE__).'/config/tcpdf_config.php') [line 130]<br />
main configuration file<br /><br />require_once(dirname(__FILE__).'/htmlcolors.php') [line 152]<br /> main configuration file<br /><br />require_once(dirname(__FILE__).'/htmlcolors.php') [line 142]<br />
html colors table<br /><br />require_once(dirname(__FILE__).'/unicode_data.php') [line 147]<br /> html colors table<br /><br />require_once(dirname(__FILE__).'/unicode_data.php') [line 137]<br />
unicode data<br /><br /></div> unicode data<br /><br /></div>
<br /><br /> <br /><br />
<br /><br /> <br /><br />
<hr /> <hr />
<a name="definePDF_PRODUCER"></a> <a name="definePDF_PRODUCER"></a>
<h3>PDF_PRODUCER <span class="smalllinenumber">[line 158]</span></h3> <h3>PDF_PRODUCER <span class="smalllinenumber">[line 148]</span></h3>
<div class="tags"> <div class="tags">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border"> <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code"> <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>PDF_PRODUCER = 'TCPDF 4.9.010 (http://www.tcpdf.org)'</code> <code>PDF_PRODUCER = 'TCPDF 4.9.011 (http://www.tcpdf.org)'</code>
</td></tr></table> </td></tr></table>
</td></tr></table> </td></tr></table>
@ -121,7 +121,7 @@ unicode data<br /><br /></div>
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 06 Apr 2010 19:44:38 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:56 +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

@ -243,7 +243,7 @@ Unicode Include file for TCPDF.<br /><br /><br /><br />
<div class="credit"> <div class="credit">
<hr /> <hr />
Documentation generated on Tue, 06 Apr 2010 19:44:41 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:58 +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

@ -1854,7 +1854,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, 06 Apr 2010 19:44:37 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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

@ -1883,7 +1883,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, 06 Apr 2010 19:44:37 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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, 06 Apr 2010 19:44:41 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:58 +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

@ -64,7 +64,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, 06 Apr 2010 19:44:37 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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

@ -64,7 +64,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, 06 Apr 2010 19:44:37 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> Documentation generated on Wed, 07 Apr 2010 10:00:55 +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_057.php // File name : example_057.php
// Begin : 2010-04-03 // Begin : 2010-04-03
// Last Update : 2010-04-06 // Last Update : 2010-04-07
// //
// Description : Example 057 for TCPDF class // Description : Example 057 for TCPDF class
// Cell vertical alignments // Cell vertical alignments
@ -70,32 +70,53 @@ $pdf->setLanguageArray($l);
// --------------------------------------------------------- // ---------------------------------------------------------
// set font // set font
$pdf->SetFont('helvetica', '', 14); $pdf->SetFont('helvetica', '', 11);
// add a page // add a page
$pdf->AddPage(); $pdf->AddPage();
$pdf->SetLineWidth(0.7);
$pdf->setCellHeightRatio(3); $pdf->setCellHeightRatio(3);
$pdf->SetXY(17, 50); $pdf->SetXY(15, 50);
$pdf->Cell(35, 0, 'Cell Top', 1, $ln=0, 'C', 0, '', 0, false, 'T'); // text on center
$pdf->Cell(35, 0, 'Font Top', 1, $ln=0, 'C', 0, '', 0, false, 'A'); $pdf->Cell(30, 0, 'Top-Center', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'C');
$pdf->Cell(35, 0, 'Font Baseline', 1, $ln=0, 'C', 0, '', 0, false, 'L'); $pdf->Cell(30, 0, 'Center-Center', 1, $ln=0, 'C', 0, '', 0, false, 'C', 'C');
$pdf->Cell(35, 0, 'Font Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'D'); $pdf->Cell(30, 0, 'Bottom-Center', 1, $ln=0, 'C', 0, '', 0, false, 'B', 'C');
$pdf->Cell(35, 0, 'Cell Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'B'); $pdf->Cell(30, 0, 'Ascent-Center', 1, $ln=0, 'C', 0, '', 0, false, 'A', 'C');
$pdf->Cell(30, 0, 'Baseline-Center', 1, $ln=0, 'C', 0, '', 0, false, 'L', 'C');
$pdf->Cell(30, 0, 'Descent-Center', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'C');
$pdf->SetXY(15, 80);
$pdf->SetXY(30, 70); // text on top
$pdf->Cell(30, 0, 'Top-Top', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'T');
$pdf->Cell(50, 0, 'Text Top', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'T'); $pdf->Cell(30, 0, 'Center-Top', 1, $ln=0, 'C', 0, '', 0, false, 'C', 'T');
$pdf->Cell(50, 0, 'Text Center', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'M'); $pdf->Cell(30, 0, 'Bottom-Top', 1, $ln=0, 'C', 0, '', 0, false, 'B', 'T');
$pdf->Cell(50, 0, 'Text Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'B'); $pdf->Cell(30, 0, 'Ascent-Top', 1, $ln=0, 'C', 0, '', 0, false, 'A', 'T');
$pdf->Cell(30, 0, 'Baseline-Top', 1, $ln=0, 'C', 0, '', 0, false, 'L', 'T');
$pdf->Cell(30, 0, 'Descent-Top', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'T');
$pdf->SetXY(15, 110);
// text on bottom
$pdf->Cell(30, 0, 'Top-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'B');
$pdf->Cell(30, 0, 'Center-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'C', 'B');
$pdf->Cell(30, 0, 'Bottom-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'B', 'B');
$pdf->Cell(30, 0, 'Ascent-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'A', 'B');
$pdf->Cell(30, 0, 'Baseline-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'L', 'B');
$pdf->Cell(30, 0, 'Descent-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'B');
// draw some reference lines
$linestyle = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(255, 0, 0)); $linestyle = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(255, 0, 0));
$pdf->Line(15, 50, 195, 50, $linestyle); $pdf->Line(15, 50, 195, 50, $linestyle);
$pdf->Line(15, 80, 195, 80, $linestyle);
$pdf->Line(15, 110, 195, 110, $linestyle);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

172
tcpdf.php
View File

@ -2,9 +2,9 @@
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2010-04-06 // Last Update : 2010-04-07
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org // Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
// Version : 4.9.010 // Version : 4.9.011
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l. // Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l.
@ -35,31 +35,26 @@
// //
// Main features: // Main features:
// * no external libraries are required for the basic functions; // * no external libraries are required for the basic functions;
// * supports all ISO page formats; // * all ISO page formats, custom page formats, custom margins and units of measure;
// * supports custom page formats, margins and units of measure; // * UTF-8 Unicode and Right-To-Left languages;
// * supports UTF-8 Unicode and Right-To-Left languages; // * TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;
// * supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts; // * methods to publish some XHTML code, Javascript and Forms;
// * supports document encryption; // * images, graphic (geometric figures) and transformation methods;
// * includes methods to publish some XHTML code, including forms; // * supports JPEG and PNG 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)
// * includes graphic (geometric) and transformation methods; // * 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;
// * includes Javascript and Forms support; // * Grayscale, RGB, CMYK, Spot Colors and Transparencies;
// * includes a method to print various barcode formats: 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; // * automatic page header and footer management;
// * includes methods to set Bookmarks and print a Table of Content; // * document encryption and digital signature certifications;
// * includes methods to move and delete pages; // * transactions to UNDO commands;
// * includes methods for automatic page header and footer management; // * PDF annotations, including links, text and file attachments;
// * supports multi-column mode; // * text rendering modes (fill, stroke and clipping);
// * supports automatic page break; // * multiple columns mode;
// * supports automatic page numbering and page groups; // * bookmarks and table of content;
// * supports automatic line break and text justification; // * text hyphenation;
// * supports JPEG and PNG 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) // * automatic page break, line break and text alignments including justification;
// * supports stroke and clipping mode for text; // * automatic page numbering and page groups;
// * supports clipping masks; // * move and delete pages;
// * supports Grayscale, RGB, CMYK, Spot Colors and Transparencies; // * page compression (requires php-zlib extension);
// * supports several annotations, including links, text and file attachments;
// * supports page compression (requires zlib extension);
// * supports text hyphenation.
// * supports transactions to UNDO commands.
// * supports signature certifications.
// //
// ----------------------------------------------------------- // -----------------------------------------------------------
// THANKS TO: // THANKS TO:
@ -97,32 +92,27 @@
* 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> * 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>
* <h3>TCPDF main features are:</h3> * <h3>TCPDF main features are:</h3>
* <ul> * <ul>
* <li>no external libraries are required for the basic functions;</li> * <li>no external libraries are required for the basic functions;</li>
* <li>supports all ISO page formats;</li> * <li>all ISO page formats, custom page formats, custom margins and units of measure;</li>
* <li>supports custom page formats, margins and units of measure;</li> * <li>UTF-8 Unicode and Right-To-Left languages;</li>
* <li>supports UTF-8 Unicode and Right-To-Left languages;</li> * <li>TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;</li>
* <li>supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;</li> * <li>methods to publish some XHTML code, Javascript and Forms;</li>
* <li>supports document encryption;</li> * <li>images, graphic (geometric figures) and transformation methods;
* <li>includes methods to publish some XHTML code, including forms;</li> * <li>supports JPEG and PNG 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>includes graphic (geometric) and transformation methods;</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;</li>
* <li>includes Javascript and Forms support;</li> * <li>Grayscale, RGB, CMYK, Spot Colors and Transparencies;</li>
* <li>includes a method to print various barcode formats: 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</li> * <li>automatic page header and footer management;</li>
* <li>includes methods to set Bookmarks and print a Table of Content;</li> * <li>document encryption and digital signature certifications;</li>
* <li>includes methods to move and delete pages;</li> * <li>transactions to UNDO commands;</li>
* <li>includes methods for automatic page header and footer management;</li> * <li>PDF annotations, including links, text and file attachments;</li>
* <li>supports multi-column mode;</li> * <li>text rendering modes (fill, stroke and clipping);</li>
* <li>supports automatic page break;</li> * <li>multiple columns mode;</li>
* <li>supports automatic page numbering and page groups;</li> * <li>bookmarks and table of content;</li>
* <li>supports automatic line break and text justification;</li> * <li>text hyphenation;</li>
* <li>supports JPEG and PNG 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>automatic page break, line break and text alignments including justification;</li>
* <li>supports stroke and clipping mode for text;</li> * <li>automatic page numbering and page groups;</li>
* <li>supports clipping masks;</li> * <li>move and delete pages;</li>
* <li>supports Grayscale, RGB, CMYK, Spot Colors and Transparencies;</li> * <li>page compression (requires php-zlib extension);</li>
* <li>supports several annotations, including links, text and file attachments;</li>
* <li>supports page compression (requires zlib extension);</li>
* <li>supports text hyphenation.</li>
* <li>supports transactions to UNDO commands.</li>
* <li>supports signature certifications.</li>
* </ul> * </ul>
* Tools to encode your unicode fonts are on fonts/utils directory.</p> * Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
@ -131,7 +121,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 4.9.010 * @version 4.9.011
*/ */
/** /**
@ -155,14 +145,14 @@ if (!class_exists('TCPDF', false)) {
/** /**
* define default PDF document producer * define default PDF document producer
*/ */
define('PDF_PRODUCER', 'TCPDF 4.9.010 (http://www.tcpdf.org)'); define('PDF_PRODUCER', 'TCPDF 4.9.011 (http://www.tcpdf.org)');
/** /**
* This is a PHP class for generating PDF documents without requiring external extensions.<br> * This is a PHP class for generating PDF documents without requiring external extensions.<br>
* TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br> * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br>
* @name TCPDF * @name TCPDF
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @version 4.9.010 * @version 4.9.011
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org * @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL * @license http://www.gnu.org/copyleft/lesser.html LGPL
@ -3832,7 +3822,7 @@ if (!class_exists('TCPDF', false)) {
* @param mixed $link URL or identifier returned by AddLink(). * @param mixed $link URL or identifier returned by AddLink().
* @param int $stretch stretch carachter mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if necessary</li><li>2 = forced horizontal scaling</li><li>3 = character spacing only if necessary</li><li>4 = forced character spacing</li></ul> * @param int $stretch stretch carachter mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if necessary</li><li>2 = forced horizontal scaling</li><li>3 = character spacing only if necessary</li><li>4 = forced character spacing</li></ul>
* @param boolean $ignore_min_height if true ignore automatic minimum height value. * @param boolean $ignore_min_height if true ignore automatic minimum height value.
* @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:<ul><li>T : cell top</li><li>A : font top</li><li>L : font baseline</li><li>D : font bottom</li><li>B : cell bottom</li></ul> * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:<ul><li>T : cell top</li><li>C : center</li><li>B : cell bottom</li><li>A : font top</li><li>L : font baseline</li><li>D : font bottom</li></ul>
* @param string $valign text vertical alignment inside the cell. Possible values are:<ul><li>T : top</li><li>C : center</li><li>B : bottom</li></ul> * @param string $valign text vertical alignment inside the cell. Possible values are:<ul><li>T : top</li><li>C : center</li><li>B : bottom</li></ul>
* @access public * @access public
* @since 1.0 * @since 1.0
@ -3887,7 +3877,7 @@ if (!class_exists('TCPDF', false)) {
* @param mixed $link URL or identifier returned by AddLink(). * @param mixed $link URL or identifier returned by AddLink().
* @param int $stretch stretch carachter mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if necessary</li><li>2 = forced horizontal scaling</li><li>3 = character spacing only if necessary</li><li>4 = forced character spacing</li></ul> * @param int $stretch stretch carachter mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if necessary</li><li>2 = forced horizontal scaling</li><li>3 = character spacing only if necessary</li><li>4 = forced character spacing</li></ul>
* @param boolean $ignore_min_height if true ignore automatic minimum height value. * @param boolean $ignore_min_height if true ignore automatic minimum height value.
* @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:<ul><li>T : cell top</li><li>A : font top</li><li>L : font baseline</li><li>D : font bottom</li><li>B : cell bottom</li></ul> * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:<ul><li>T : cell top</li><li>C : center</li><li>B : cell bottom</li><li>A : font top</li><li>L : font baseline</li><li>D : font bottom</li></ul>
* @param string $valign text vertical alignment inside the cell. Possible values are:<ul><li>T : top</li><li>C : center</li><li>B : bottom</li></ul> * @param string $valign text vertical alignment inside the cell. Possible values are:<ul><li>T : top</li><li>C : center</li><li>B : bottom</li></ul>
* @access protected * @access protected
* @since 1.0 * @since 1.0
@ -3909,17 +3899,68 @@ if (!class_exists('TCPDF', false)) {
switch ($calign) { switch ($calign) {
case 'A': { case 'A': {
// font top // font top
$y -= (($h - $this->FontAscent - $this->FontDescent) / 2); switch ($valign) {
case 'T': {
// top
$y -= ($this->LineWidth / 2);
break;
}
case 'B': {
// bottom
$y -= ($h - $this->FontAscent - $this->FontDescent - ($this->LineWidth / 2));
break;
}
default:
case 'M': {
// center
$y -= (($h - $this->FontAscent - $this->FontDescent) / 2);
break;
}
}
break; break;
} }
case 'L': { case 'L': {
// font baseline // font baseline
$y -= (($h + $this->FontAscent - $this->FontDescent) / 2); switch ($valign) {
case 'T': {
// top
$y -= ($this->FontAscent + ($this->LineWidth / 2));
break;
}
case 'B': {
// bottom
$y -= ($h - $this->FontDescent - ($this->LineWidth / 2));
break;
}
default:
case 'M': {
// center
$y -= (($h + $this->FontAscent - $this->FontDescent) / 2);
break;
}
}
break; break;
} }
case 'D': { case 'D': {
// font bottom // font bottom
$y -= (($h + $this->FontAscent + $this->FontDescent) / 2); switch ($valign) {
case 'T': {
// top
$y -= ($this->FontAscent + $this->FontDescent + ($this->LineWidth / 2));
break;
}
case 'B': {
// bottom
$y -= ($h - ($this->LineWidth / 2));
break;
}
default:
case 'M': {
// center
$y -= (($h + $this->FontAscent + $this->FontDescent) / 2);
break;
}
}
break; break;
} }
case 'B': { case 'B': {
@ -3927,6 +3968,11 @@ if (!class_exists('TCPDF', false)) {
$y -= $h; $y -= $h;
break; break;
} }
case 'C': {
// cell center
$y -= ($h / 2);
break;
}
default: default:
case 'T': { case 'T': {
// cell top // cell top
@ -3937,12 +3983,12 @@ if (!class_exists('TCPDF', false)) {
switch ($valign) { switch ($valign) {
case 'T': { case 'T': {
// top // top
$basefonty = $y + $this->FontAscent + $this->LineWidth; $basefonty = $y + $this->FontAscent + ($this->LineWidth / 2);
break; break;
} }
case 'B': { case 'B': {
// bottom // bottom
$basefonty = $y + $h - $this->FontDescent - $this->LineWidth; $basefonty = $y + $h - $this->FontDescent - ($this->LineWidth / 2);
break; break;
} }
default: default: