32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2025-02-11 13:18:29 +00:00
This commit is contained in:
nicolaasuni 2010-04-02 15:30:26 +02:00
parent f6f2bef5bc
commit fc6fbbcc4b
23 changed files with 475 additions and 370 deletions

View File

@ -1,3 +1,7 @@
4.9.006 (2010-04-02)
- The constant K_TCPDF_CALLS_IN_HTML was added on configuration file to enable/disable the ability to call TCPDF methods in HTML.
- The usage of tcpdf tag in HTML mode was changed to remove the possible security flaw offered by the eval() function. See the new example n. 49 for further information.
4.9.005 (2010-04-01)
- Bug# 2980354 "Wrong File attachment description with security" was fixed.
- Several problems with HTML line alignment were fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 4.9.005
Release date: 2010-04-01
Version: 4.9.006
Release date: 2010-04-02
Author: Nicola Asuni
Copyright (c) 2001-2010:

View File

@ -2,7 +2,7 @@
//============================================================+
// File name : tcpdf_config.php
// Begin : 2004-06-11
// Last Update : 2010-04-01
// Last Update : 2010-04-02
//
// Description : Configuration file for TCPDF.
//
@ -230,6 +230,12 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
* set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
*/
define('K_THAI_TOPCHARS', true);
/**
* if true allows to call TCPDF methods using HTML syntax
* IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
*/
define('K_TCPDF_CALLS_IN_HTML', true);
}
//============================================================+

View File

@ -2,7 +2,7 @@
//============================================================+
// File name : tcpdf_config.php
// Begin : 2004-06-11
// Last Update : 2010-04-01
// Last Update : 2010-04-02
//
// Description : Alternative configuration file for TCPDF.
//
@ -226,6 +226,12 @@ define('K_SMALL_RATIO', 2/3);
*/
define('K_THAI_TOPCHARS', true);
/**
* if true allows to call TCPDF methods using HTML syntax
* IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
*/
define('K_TCPDF_CALLS_IN_HTML', true);
//============================================================+
// END OF FILE
//============================================================+

View File

@ -55,7 +55,7 @@
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -5548,7 +5548,7 @@ $frame)</code>
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +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

@ -296,7 +296,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1374,7 +1374,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -102,7 +102,7 @@ PHP class to creates array representations for 2D barcodes to be used with TCPDF
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -102,7 +102,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -223,6 +223,19 @@ Configuration file for TCPDF.<br /><br /><br /><br />
reduction factor for small font<br /><br /> <br />
</div>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
<hr />
<a name="defineK_TCPDF_CALLS_IN_HTML"></a>
<h3>K_TCPDF_CALLS_IN_HTML <span class="smalllinenumber">[line 238]</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>K_TCPDF_CALLS_IN_HTML = true</code>
</td></tr></table>
</td></tr></table>
if true allows to call TCPDF methods using HTML syntax IMPORTANT: For security reason, disable this feature if you are printing user HTML content.<br /><br /> <br />
</div>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
<hr />
<a name="defineK_THAI_TOPCHARS"></a>
<h3>K_THAI_TOPCHARS <span class="smalllinenumber">[line 232]</span></h3>
@ -526,7 +539,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:07 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:07 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -94,7 +94,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -477,7 +477,7 @@ string $string, [int $split_length = 1])</code>
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -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>
</tr>
<tr>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.9.005</td>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.9.006</td>
</tr>
<tr>
<td><b>copyright:</b>&nbsp;&nbsp;</td><td>2002-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com</td>
@ -110,7 +110,7 @@ unicode data<br /><br /></div>
<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 4.9.005 (http://www.tcpdf.org)'</code>
<code>PDF_PRODUCER = 'TCPDF 4.9.006 (http://www.tcpdf.org)'</code>
</td></tr></table>
</td></tr></table>
@ -121,7 +121,7 @@ unicode data<br /><br /></div>
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:05 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:05 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -243,7 +243,7 @@ Unicode Include file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:07 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:07 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -843,6 +843,8 @@
<dd>in file unicode_data.php, constant <a href="com-tecnick-tcpdf/_unicode_data.php.html#defineK_RLO">K_RLO</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Right-to-Left Override</dd>
<dt><b>K_SMALL_RATIO</b></dt>
<dd>in file tcpdf_config.php, constant <a href="com-tecnick-tcpdf/_config---tcpdf_config.php.html#defineK_SMALL_RATIO">K_SMALL_RATIO</a><br>&nbsp;&nbsp;&nbsp;&nbsp;reduction factor for small font</dd>
<dt><b>K_TCPDF_CALLS_IN_HTML</b></dt>
<dd>in file tcpdf_config.php, constant <a href="com-tecnick-tcpdf/_config---tcpdf_config.php.html#defineK_TCPDF_CALLS_IN_HTML">K_TCPDF_CALLS_IN_HTML</a><br>&nbsp;&nbsp;&nbsp;&nbsp;if true allows to call TCPDF methods using HTML syntax IMPORTANT: For security reason, disable this feature if you are printing user HTML content.</dd>
<dt><b>K_THAI_TOPCHARS</b></dt>
<dd>in file tcpdf_config.php, constant <a href="com-tecnick-tcpdf/_config---tcpdf_config.php.html#defineK_THAI_TOPCHARS">K_THAI_TOPCHARS</a><br>&nbsp;&nbsp;&nbsp;&nbsp;set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language</dd>
<dt><b>K_TITLE_MAGNIFICATION</b></dt>
@ -1311,6 +1313,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodScaleY">TCPDF::ScaleY()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Vertical Scaling.</dd>
<dt><b>selectColumn</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodselectColumn">TCPDF::selectColumn()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set position at a given column</dd>
<dt><b>serializeTCPDFtagParameters</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodserializeTCPDFtagParameters">TCPDF::serializeTCPDFtagParameters()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Serialize an array of parameters to be used with TCPDF tag in HTML code.</dd>
<dt><b>setAlpha</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetAlpha">TCPDF::setAlpha()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set alpha for stroking (CA) and non-stroking (ca) operations.</dd>
<dt><b>SetAuthor</b></dt>
@ -1320,9 +1324,9 @@
<dt><b>setBarcode</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetBarcode">TCPDF::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set document barcode.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodsetBarcode">TCPDFBarcode::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the barcode.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file 2dbarcodes.php, method <a href="com-tecnick-tcpdf/TCPDF2DBarcode.html#methodsetBarcode">TCPDF2DBarcode::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the barcode.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodsetBarcode">TCPDFBarcode::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the barcode.</dd>
<dt><b>SetBooklet</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetBooklet">TCPDF::SetBooklet()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the booklet mode for double-sided pages.</dd>
<dt><b>setBuffer</b></dt>
@ -1430,7 +1434,7 @@
<dt><b>setPageFormat</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetPageFormat">TCPDF::setPageFormat()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the page format</dd>
<dt><b>setPageMark</b></dt>
<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 for multicell borders and fills.</dd>
<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>setPageUnit</b></dt>
@ -1840,7 +1844,7 @@
<a href="elementindex.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1006,6 +1006,8 @@
<dd>in file unicode_data.php, constant <a href="com-tecnick-tcpdf/_unicode_data.php.html#defineK_RLO">K_RLO</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Right-to-Left Override</dd>
<dt><b>K_SMALL_RATIO</b></dt>
<dd>in file tcpdf_config.php, constant <a href="com-tecnick-tcpdf/_config---tcpdf_config.php.html#defineK_SMALL_RATIO">K_SMALL_RATIO</a><br>&nbsp;&nbsp;&nbsp;&nbsp;reduction factor for small font</dd>
<dt><b>K_TCPDF_CALLS_IN_HTML</b></dt>
<dd>in file tcpdf_config.php, constant <a href="com-tecnick-tcpdf/_config---tcpdf_config.php.html#defineK_TCPDF_CALLS_IN_HTML">K_TCPDF_CALLS_IN_HTML</a><br>&nbsp;&nbsp;&nbsp;&nbsp;if true allows to call TCPDF methods using HTML syntax IMPORTANT: For security reason, disable this feature if you are printing user HTML content.</dd>
<dt><b>K_THAI_TOPCHARS</b></dt>
<dd>in file tcpdf_config.php, constant <a href="com-tecnick-tcpdf/_config---tcpdf_config.php.html#defineK_THAI_TOPCHARS">K_THAI_TOPCHARS</a><br>&nbsp;&nbsp;&nbsp;&nbsp;set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language</dd>
<dt><b>K_TITLE_MAGNIFICATION</b></dt>
@ -1474,6 +1476,8 @@
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodScaleY">TCPDF::ScaleY()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Vertical Scaling.</dd>
<dt><b>selectColumn</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodselectColumn">TCPDF::selectColumn()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set position at a given column</dd>
<dt><b>serializeTCPDFtagParameters</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodserializeTCPDFtagParameters">TCPDF::serializeTCPDFtagParameters()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Serialize an array of parameters to be used with TCPDF tag in HTML code.</dd>
<dt><b>setAlpha</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetAlpha">TCPDF::setAlpha()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set alpha for stroking (CA) and non-stroking (ca) operations.</dd>
<dt><b>SetAuthor</b></dt>
@ -1483,9 +1487,9 @@
<dt><b>setBarcode</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetBarcode">TCPDF::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set document barcode.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodsetBarcode">TCPDFBarcode::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the barcode.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file 2dbarcodes.php, method <a href="com-tecnick-tcpdf/TCPDF2DBarcode.html#methodsetBarcode">TCPDF2DBarcode::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the barcode.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodsetBarcode">TCPDFBarcode::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the barcode.</dd>
<dt><b>SetBooklet</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetBooklet">TCPDF::SetBooklet()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the booklet mode for double-sided pages.</dd>
<dt><b>setBuffer</b></dt>
@ -1593,7 +1597,7 @@
<dt><b>setPageFormat</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetPageFormat">TCPDF::setPageFormat()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the page format</dd>
<dt><b>setPageMark</b></dt>
<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 for multicell borders and fills.</dd>
<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>setPageUnit</b></dt>
@ -1869,7 +1873,7 @@
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Thu, 01 Apr 2010 20:40:03 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +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 Thu, 01 Apr 2010 20:40:07 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:07 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -64,7 +64,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 Thu, 01 Apr 2010 20:40:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -64,7 +64,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 Thu, 01 Apr 2010 20:40:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 02 Apr 2010 15:30:04 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -2,13 +2,13 @@
//============================================================+
// File name : example_049.php
// Begin : 2009-04-03
// Last Update : 2009-09-30
//
// Last Update : 2010-04-02
//
// Description : Example 049 for TCPDF class
// WriteHTML with TCPDF callback functions
//
//
// Author: Nicola Asuni
//
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
@ -34,7 +34,7 @@ require_once('../config/lang/eng.php');
require_once('../tcpdf.php');
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
@ -75,36 +75,46 @@ $pdf->SetFont('helvetica', '', 10);
// add a page
$pdf->AddPage();
/*
NOTE:
When using TCPDF methods embedded on XHTML code, you have to escape special
characters with equivalent HTML entities:
- replace double quotes with: &quot;
- replace single quote with: &#x5c;&#x27;
- replace > with: &gt;
- replace < with: &lt;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Note that the single quote escape contains an additional back-slash character.
*/
IMPORTANT:
If you are printing user-generated content, tcpdf tag can be unsafe.
You can disable this tag by setting to false the K_TCPDF_CALLS_IN_HTML
constant on TCPDF configuration file.
The parameters for the 'params' attribute of TCPDF tag must be prepared
as an array and encoded with the serializeTCPDFtagParameters() method
(see the example below).
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
$html = '<h1>Test TCPDF Methods in HTML</h1>
<h2 style="color:red;">IMPORTANT:</h2>
<span style="color:red;">If you are printing user-generated content, tcpdf tag can be unsafe.<br />
You can disable this tag by setting to false the <b>K_TCPDF_CALLS_IN_HTML</b> constant on TCPDF configuration file.</span>
<h2>write1DBarcode method in HTML</h2>';
$params = $pdf->serializeTCPDFtagParameters(array('CODE 39', 'C39', '', '', 80, 30, 0.4, array('position'=>'S', 'border'=>true, 'padding'=>4, 'fgcolor'=>array(0,0,0), 'bgcolor'=>array(255,255,255), 'text'=>true, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>4), 'N'));
$html .= '<tcpdf method="write1DBarcode" params="'.$params.'" />';
$params = $pdf->serializeTCPDFtagParameters(array('CODE 128C+', 'C128C', '', '', 80, 30, 0.4, array('position'=>'S', 'border'=>true, 'padding'=>4, 'fgcolor'=>array(0,0,0), 'bgcolor'=>array(255,255,255), 'text'=>true, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>4), 'N'));
$html .= '<tcpdf method="write1DBarcode" params="'.$params.'" />';
$html .= '<tcpdf method="AddPage" />
<h2> Graphic Functions</h2>';
$params = $pdf->serializeTCPDFtagParameters(array(0));
$html .= '<tcpdf method="SetDrawColor" params="'.$params.'" />';
$params = $pdf->serializeTCPDFtagParameters(array(50, 50, 40, 10, 'DF', array(), array(0,128,255)));
$html .= '<tcpdf method="Rect" params="'.$params.'" />';
$htmlcontent = <<<EOF
<h1>Test TCPDF Methods in HTML</h1>
<h2>write1DBarcode method in HTML</h2>
<tcpdf method="write1DBarcode" params="'CODE 39', 'C39', '', '', 80, 30, 0.4, array('position'=&gt;'S', 'border'=&gt;true, 'padding'=&gt;4, 'fgcolor'=&gt;array(0,0,0), 'bgcolor'=&gt;array(255,255,255), 'text'=&gt;true, 'font'=&gt;'helvetica', 'fontsize'=&gt;8, 'stretchtext'=&gt;4), 'N'" />
<tcpdf method="write1DBarcode" params="'CODE 128C+ &quot; &#x5c;&#x27;',
'C128C', '', '', 80, 30, 0.4, array('position'=&gt;'S', 'border'=&gt;true,
'padding'=&gt;4, 'fgcolor'=&gt;array(0,0,0),
'bgcolor'=&gt;array(255,255,255), 'text'=&gt;true, 'font'=&gt;'helvetica',
'fontsize'=&gt;8, 'stretchtext'=&gt;4), 'N'" />
<tcpdf method="AddPage" />
<h2> Graphic Functions</h2>
<tcpdf method="SetDrawColor" params="0" />
<tcpdf method="Rect" params="50, 50, 40, 10, 'DF', array(), array(0,128,255)" />
EOF;
// output the HTML content
$pdf->writeHTML($htmlcontent, true, 0, true, 0);
$pdf->writeHTML($html, true, 0, true, 0);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -117,6 +127,6 @@ $pdf->lastPage();
$pdf->Output('example_049.pdf', 'I');
//============================================================+
// END OF FILE
// END OF FILE
//============================================================+
?>

View File

@ -2,9 +2,9 @@
//============================================================+
// File name : tcpdf.php
// Begin : 2002-08-03
// Last Update : 2010-04-01
// Last Update : 2010-04-02
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
// Version : 4.9.005
// Version : 4.9.006
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// ----------------------------------------------------------------------------
// Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l.
@ -131,7 +131,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 4.9.005
* @version 4.9.006
*/
/**
@ -155,14 +155,14 @@ if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
define('PDF_PRODUCER', 'TCPDF 4.9.005 (http://www.tcpdf.org)');
define('PDF_PRODUCER', 'TCPDF 4.9.006 (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 4.9.005
* @version 4.9.006
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@ -2504,7 +2504,8 @@ if (!class_exists('TCPDF', false)) {
}
/**
* Set start-writing mark on current page for multicell borders and fills.
* Set start-writing mark on current page stream used to put borders and fills.
* Borders and fills are always created after content and inserted on the position marked by this method.
* This function must be called after calling Image() function for a background image.
* Background images must be always inserted before calling Multicell() or WriteHTMLCell() or WriteHTML() functions.
* @access public
@ -15419,19 +15420,22 @@ if (!class_exists('TCPDF', false)) {
break;
}
case 'tcpdf': {
// NOT HTML: used to call TCPDF methods
if (isset($tag['attribute']['method'])) {
$tcpdf_method = $tag['attribute']['method'];
if (method_exists($this, $tcpdf_method)) {
if (isset($tag['attribute']['params']) AND (!empty($tag['attribute']['params']))) {
eval('$params = array('.$this->unhtmlentities($tag['attribute']['params']).');');
call_user_func_array(array($this, $tcpdf_method), $params);
} else {
$this->$tcpdf_method();
if (defined('K_TCPDF_CALLS_IN_HTML') AND (K_TCPDF_CALLS_IN_HTML === true)) {
// Special tag used to call TCPDF methods
if (isset($tag['attribute']['method'])) {
$tcpdf_method = $tag['attribute']['method'];
if (method_exists($this, $tcpdf_method)) {
if (isset($tag['attribute']['params']) AND (!empty($tag['attribute']['params']))) {
$params = unserialize(urldecode($tag['attribute']['params']));
call_user_func_array(array($this, $tcpdf_method), $params);
} else {
$this->$tcpdf_method();
}
$this->newline = true;
}
$this->newline = true;
}
}
break;
}
default: {
break;
@ -17183,6 +17187,17 @@ if (!class_exists('TCPDF', false)) {
}
}
/**
* Serialize an array of parameters to be used with TCPDF tag in HTML code.
* @param array $pararray parameters array
* @return sting containing serialized data
* @access public
* @since 4.9.006 (2010-04-02)
*/
public function serializeTCPDFtagParameters($pararray) {
return urlencode(serialize($pararray));
}
} // END OF TCPDF CLASS
}
//============================================================+