Source code for file /tcpdf/tcpdf.php
Documentation is available at tcpdf.php
//============================================================+
// Last Update : 2007-09-12
// Version : 1.53.0.TC034_PHP4
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// Description : This is a PHP4 class for generating PDF files
// on-the-fly without requiring external
// This class is an extension and improvement of the public Domain
// FPDF class by Olivier Plathey (http://www.fpdf.org).
// Main changes by Nicola Asuni:
// UTF-8 Unicode support;
// code style and formatting;
// source code documentation using phpDocumentor (www.phpdoc.org);
// All ISO page formats were included;
// includes methods to parse and printsome XHTML code, supporting the following elements: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small;
// includes a method to print various barcode formats using an improved version of "Generic Barcode Render Class" by Karim Mribti (http://www.mribti.com/barcode/) (require GD library: http://www.boutell.com/gd/);
// defines standard Header() and Footer() methods.
//============================================================+
* @package com.tecnick.tcpdf
* include configuration file
require_once(dirname(__FILE__
).
'/config/tcpdf_config.php');
* This is a PHP4 class for generating PDF files on-the-fly without requiring external extensions.<br>
* TCPDF project (http://tcpdf.sourceforge.net) is based on the public Domain FPDF class by Olivier Plathey (http://www.fpdf.org).<br>
* <h3>TCPDF main changes from FPDF are:</h3><ul>
* <li>UTF-8 Unicode support</li>
* <li>source code clean up</li>
* <li>code style and formatting</li>
* <li>source code documentation using phpDocumentor (www.phpdoc.org)</li>
* <li>All ISO page formats were included</li>
* <li>image scale factor</li>
* <li>includes methods to parse and printsome XHTML code, supporting the following elements: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small;</li>
* <li>includes a method to print various barcode formats using an improved version of "Generic Barcode Render Class" by Karim Mribti (http://www.mribti.com/barcode/) (require GD library: http://www.boutell.com/gd/)</li>
* <li>defines standard Header() and Footer() methods.</li>
* Tools to encode your unicode fonts are on fonts/ttf2ufm directory.</p>
* @package com.tecnick.tcpdf
* @abstract Class for generating PDF files on-the-fly without requiring external extensions.
* @copyright 2004-2006 Tecnick.com S.r.l (www.tecnick.com) Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@version 1.53.0.TC034_PHP4
* define default PDF document producer
define('PDF_PRODUCER','TCPDF 1.53.0.TC034_PHP4 (http://tcpdf.sourceforge.net)');
* This is a PHP4 class for generating PDF files on-the-fly without requiring external extensions.<br>
* This class is an extension and improvement of the FPDF class by Olivier Plathey (http://www.fpdf.org).<br>
* This version contains some changes: [porting to PHP4, support for UTF-8 Unicode, code style and formatting, php documentation (www.phpdoc.org), ISO page formats, minor improvements, image scale factor]<br>
* TCPDF project (http://tcpdf.sourceforge.net) is based on the public Domain FPDF class by Olivier Plathey (http://www.fpdf.org).<br>
* To add your own TTF fonts please read /fonts/README.TXT
* @package com.tecnick.tcpdf
* @version 1.53.0.TC034_PHP4
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @var current page number
* @var current object number
* @var array of object offsets
* @var buffer holding in-memory PDF
* @var array containing pages
* @var current document state
* @var default orientation
* @var current orientation
* @var array indicating orientation changes
* @var scale factor (number of points in user unit)
* @var width of page format in points
* @var height of page format in points
* @var width of page format in user unit
* @var height of page format in user unit
* @var current width of page in points
* @var current height of page in points
* @var current width of page in user unit
* @var current height of page in user unit
* @var current horizontal position in user unit for cell positioning
* @var current vertical position in user unit for cell positioning
* @var height of last cell printed
* @var line width in user unit
* @var array of standard font names
* @var array of used fonts
* @var array of font files
* @var array of encoding differences
* @var array of used images
* @var array of links in pages
* @var array of internal links
* @var current font family
* @var current font style
* @var current font size in points
* @var current font size in user unit
* @var commands for drawing color
* @var commands for filling color
* @var commands for text color
* @var indicates whether fill and text colors are different
* @var automatic page breaking
* @var threshold used to trigger page breaks
* @var flag set when processing footer
* @var layout display mode
* @var alias for total number of pages
* @var right-bottom corner X coordinate of inserted image
* @var right-bottom corner Y coordinate of inserted image
* @var image scale factor
* @var boolean set to true when the input text is unicode (require unicode fonts)
// ----------------------
* @var Minimum distance between header and top page margin.
* @var Minimum distance between footer and bottom page margin.
* @var original left margin value
* @var original right margin value
* @var Language templates.
* @var Barcode to print on page footer (only if set).
* @var If true prints header
var $print_header =
true;
* @var If true prints footer.
var $print_footer =
true;
* @var Header width (0 = full page width).
* @var Header image logo.
* @var Header image logo width in mm.
var $header_logo_width =
30;
* @var String to print as title on document header.
* @var String to print on document header.
* @var Default number of columns for html table.
var $default_table_columns =
4;
// variables for html parser
* @var HTML PARSER: store current link.
* @var HTML PARSER: store font list.
* @var HTML PARSER: true when font attribute is set.
* @var HTML PARSER: true when color attribute is set.
* @var HTML PARSER: true in case of ordered list (OL), false otherwise.
var $listordered =
false;
* @var HTML PARSER: count list items.
* @var HTML PARSER: size of table border.