📄 tcpdf.php
字号:
<?php//============================================================+// File name : tcpdf.php// Begin : 2002-08-03// Last Update : 2006-10-27// Author : Nicola Asuni// Version : 1.53.0.TC026_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 // extensions.//// IMPORTANT:// 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:// PHP4 porting;// UTF-8 Unicode support;// code refactoring;// source code clean up;// code style and formatting;// source code documentation using phpDocumentor (www.phpdoc.org);// All ISO page formats were included;// image scale factor;// 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.//============================================================+/** * include configuration file */// Disabled in phpMyAdmin//require_once(dirname(__FILE__).'/config/tcpdf_config.php');/** * TCPDF Class. * @package com.tecnick.tcpdf */ /** * 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>PHP4 porting</li> * <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> * </ul> * Tools to encode your unicode fonts are on fonts/ttf2ufm directory.</p> * @name TCPDF * @package com.tecnick.tcpdf * @abstract Class for generating PDF files on-the-fly without requiring external extensions. * @author Nicola Asuni * @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.TC026_PHP4 */if(!class_exists('TCPDF')) { /** * define default PDF document producer */ define('PDF_PRODUCER','TCPDF 1.53.0.TC026_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 * @name TCPDF * @package com.tecnick.tcpdf * @version 1.53.0.TC026_PHP4 * @author Nicola Asuni * @link http://tcpdf.sourceforge.net * @license http://www.gnu.org/copyleft/lesser.html LGPL */ class TCPDF { //var properties /** * @var current page number * @access protected */ var $page; /** * @var current object number * @access protected */ var $n; /** * @var array of object offsets * @access protected */ var $offsets; /** * @var buffer holding in-memory PDF * @access protected */ var $buffer; /** * @var array containing pages * @access protected */ var $pages; /** * @var current document state * @access protected */ var $state; /** * @var compression flag * @access protected */ var $compress; /** * @var default orientation * @access protected */ var $DefOrientation; /** * @var current orientation * @access protected */ var $CurOrientation; /** * @var array indicating orientation changes * @access protected */ var $OrientationChanges; /** * @var scale factor (number of points in user unit) * @access protected */ var $k; /** * @var width of page format in points * @access protected */ var $fwPt; /** * @var height of page format in points * @access protected */ var $fhPt; /** * @var width of page format in user unit * @access protected */ var $fw; /** * @var height of page format in user unit * @access protected */ var $fh; /** * @var current width of page in points * @access protected */ var $wPt; /** * @var current height of page in points * @access protected */ var $hPt; /** * @var current width of page in user unit * @access protected */ var $w; /** * @var current height of page in user unit * @access protected */ var $h; /** * @var left margin * @access protected */ var $lMargin; /** * @var top margin * @access protected */ var $tMargin; /** * @var right margin * @access protected */ var $rMargin; /** * @var page break margin * @access protected */ var $bMargin; /** * @var cell margin * @access protected */ var $cMargin; /** * @var current horizontal position in user unit for cell positioning * @access protected */ var $x; /** * @var current vertical position in user unit for cell positioning * @access protected */ var $y; /** * @var height of last cell printed * @access protected */ var $lasth; /** * @var line width in user unit * @access protected */ var $LineWidth; /** * @var array of standard font names * @access protected */ var $CoreFonts; /** * @var array of used fonts * @access protected */ var $fonts; /** * @var array of font files * @access protected */ var $FontFiles; /** * @var array of encoding differences * @access protected */ var $diffs; /** * @var array of used images * @access protected */ var $images; /** * @var array of links in pages * @access protected */ var $PageLinks; /** * @var array of internal links * @access protected */ var $links; /** * @var current font family * @access protected */ var $FontFamily; /** * @var current font style * @access protected */ var $FontStyle; /** * @var underlining flag * @access protected */ var $underline; /** * @var current font info * @access protected */ var $CurrentFont; /** * @var current font size in points * @access protected */ var $FontSizePt; /** * @var current font size in user unit * @access protected */ var $FontSize; /** * @var commands for drawing color * @access protected */ var $DrawColor; /** * @var commands for filling color * @access protected */ var $FillColor; /** * @var commands for text color * @access protected */ var $TextColor; /** * @var indicates whether fill and text colors are different * @access protected */ var $ColorFlag; /** * @var word spacing * @access protected */ var $ws; /** * @var automatic page breaking * @access protected */ var $AutoPageBreak; /** * @var threshold used to trigger page breaks * @access protected */ var $PageBreakTrigger; /** * @var flag set when processing footer * @access protected */ var $InFooter; /** * @var zoom display mode * @access protected */ var $ZoomMode; /** * @var layout display mode * @access protected */ var $LayoutMode; /** * @var title * @access protected */ var $title; /** * @var subject * @access protected */ var $subject; /** * @var author * @access protected */ var $author; /** * @var keywords * @access protected */ var $keywords; /** * @var creator * @access protected */ var $creator; /** * @var alias for total number of pages * @access protected */ var $AliasNbPages;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -