📄 tcpdf.php
字号:
<?php//============================================================+// File name : tcpdf.php// Begin : 2002-08-03// Last Update : 2008-02-28// Author : Nicola Asuni// Version : 2.2.002// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)//// Description : This is a PHP5 class for generating PDF files // on-the-fly without requiring external // extensions.//// IMPORTANT:// This class was originally derived in 2002 from the Public // Domain FPDF class by Olivier Plathey (http://www.fpdf.org).//// Main features:// - supports all ISO page formats; // - supports UTF-8 Unicode and Right-To-Left languages; // - supports document encryption; // - includes methods to publish some xhtml code; // - includes graphic and transformation methods;// - includes bookmarks;// - includes Javascript and forms support;// - 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/) // - supports TrueTypeUnicode, TrueType, Type1 and encoding; // - supports custom page formats, margins and units of measure; // - includes methods for page header and footer management; // - supports automatic page break; // - supports automatic page numbering; // - supports automatic line break and text justification; // - supports JPEG, PNG anf GIF images; // - supports colors; // - supports links; // - support page compression (require zlib extension: http://www.gzip.org/zlib/); // - the source code is full documented in PhpDocumentor Style (http://www.phpdoc.org). //// -----------------------------------------------------------// THANKS TO:// // Olivier Plathey (http://www.fpdf.org) for original FPDF.// Efthimios Mavrogeorgiadis (emavro@yahoo.com) for suggestions on RTL language support.// Klemen Vodopivec (http://www.fpdf.de/downloads/addons/37/) for Encryption algorithm.// Warren Sherliker (wsherliker@gmail.com) for better image handling.// dullus for text Justification.// Bob Vincent (pillarsdotnet@users.sourceforge.net) for <li> value attribute.// Patrick Benny for text stretch suggestion on Cell().// Johannes G黱tert for JavaScript support.// Denis Van Nuffelen for Dynamic Form.// Jacek Czekaj for multibyte justification// Anthony Ferrara for the reintroduction of legacy image methods.// Anyone that has reported a bug or sent a suggestion.//============================================================+/** * This is a PHP5 class for generating PDF files on-the-fly without requiring external extensions.<br> * TCPDF project (http://tcpdf.sourceforge.net) has been originally derived from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org).<br> * <h3>TCPDF main features are:</h3> * <ul> * <li>supports all ISO page formats;</li> * <li>supports UTF-8 Unicode and Right-To-Left languages;</li> * <li>supports document encryption;</li> * <li>includes methods to publish some 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 (<a href="http://www.mribti.com/barcode/" target="_blank" title="Generic Barcode Render Class by Karim Mribti">http://www.mribti.com/barcode/</a>) (require GD library: <a href="http://www.boutell.com/gd/" target="_blank" title="GD library">http://www.boutell.com/gd/</a>)</li> * <li>supports TrueTypeUnicode, TrueType, Type1 and encoding; </li> * <li>supports custom page formats, margins and units of measure;</li> * <li>includes methods for page header and footer management;</li> * <li>supports automatic page break;</li> * <li>supports automatic page numbering;</li> * <li>supports automatic line break and text justification;</li> * <li>supports JPEG, PNG anf GIF images;</li> * <li>supports colors;</li> * <li>supports links;</li> * <li>support page compression (require zlib extension: <a href="http://www.gzip.org/zlib/" target="_blank" title="zlib">http://www.gzip.org/zlib/</a>);</li> * <li>the source code is full documented in PhpDocumentor Style (<a href="http://www.phpdoc.org" target="_blank" title="phpDocumentor">http://www.phpdoc.org</a>).</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-2008 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.sourceforge.net * @license http://www.gnu.org/copyleft/lesser.html LGPL * @version 2.2.002 *//** * include configuration file * (Disabled in phpMyAdmin) *///require_once(dirname(__FILE__).'/config/tcpdf_config.php');if(!class_exists('TCPDF', false)) { /** * define default PDF document producer */ define('PDF_PRODUCER','TCPDF 2.2.002 (http://tcpdf.sf.net)'); /** * This is a PHP5 class for generating PDF files on-the-fly without requiring external extensions.<br> * TCPDF project (http://tcpdf.sourceforge.net) has been originally derived from 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 2.2.002 * @author Nicola Asuni * @link http://tcpdf.sourceforge.net * @license http://www.gnu.org/copyleft/lesser.html LGPL */ class TCPDF { // Private or Protected properties /** * @var current page number * @access protected */ protected $page; /** * @var current object number * @access protected */ protected $n; /** * @var array of object offsets * @access protected */ protected $offsets; /** * @var buffer holding in-memory PDF * @access protected */ protected $buffer; /** * @var array containing pages * @access protected */ protected $pages; /** * @var current document state * @access protected */ protected $state; /** * @var compression flag * @access protected */ protected $compress; /** * @var default page orientation (P = Portrait, L = Landscape) * @access protected */ protected $DefOrientation; /** * @var current page orientation (P = Portrait, L = Landscape) * @access protected */ protected $CurOrientation; /** * @var array indicating page orientation changes * @access protected */ protected $OrientationChanges; /** * @var scale factor (number of points in user unit) * @access protected */ protected $k; /** * @var width of page format in points * @access protected */ protected $fwPt; /** * @var height of page format in points * @access protected */ protected $fhPt; /** * @var width of page format in user unit * @access protected */ protected $fw; /** * @var height of page format in user unit * @access protected */ protected $fh; /** * @var current width of page in points * @access protected */ protected $wPt; /** * @var current height of page in points * @access protected */ protected $hPt; /** * @var current width of page in user unit * @access protected */ protected $w; /** * @var current height of page in user unit * @access protected */ protected $h; /** * @var left margin * @access protected */ protected $lMargin; /** * @var top margin * @access protected */ protected $tMargin; /** * @var right margin * @access protected */ protected $rMargin; /** * @var page break margin * @access protected */ protected $bMargin; /** * @var cell internal padding * @access protected */ protected $cMargin; /** * @var current horizontal position in user unit for cell positioning * @access protected */ protected $x; /** * @var current vertical position in user unit for cell positioning * @access protected */ protected $y; /** * @var height of last cell printed * @access protected */ protected $lasth; /** * @var line width in user unit * @access protected */ protected $LineWidth; /** * @var array of standard font names * @access protected */ protected $CoreFonts; /** * @var array of used fonts * @access protected */ protected $fonts; /** * @var array of font files * @access protected */ protected $FontFiles; /** * @var array of encoding differences * @access protected */ protected $diffs; /** * @var array of used images * @access protected */ protected $images; /** * @var array of links in pages * @access protected */ protected $PageLinks; /** * @var array of internal links * @access protected */ protected $links; /** * @var current font family * @access protected */ protected $FontFamily; /** * @var current font style * @access protected */ protected $FontStyle; /** * @var underlining flag * @access protected */ protected $underline; /** * @var current font info * @access protected */ protected $CurrentFont; /** * @var current font size in points * @access protected */ protected $FontSizePt; /** * @var current font size in user unit * @access protected */ protected $FontSize; /** * @var commands for drawing color * @access protected */ protected $DrawColor; /** * @var commands for filling color * @access protected */ protected $FillColor; /** * @var commands for text color * @access protected */ protected $TextColor; /** * @var indicates whether fill and text colors are different * @access protected */ protected $ColorFlag; /** * @var word spacing * @access protected */ protected $ws; /** * @var automatic page breaking * @access protected */ protected $AutoPageBreak; /** * @var threshold used to trigger page breaks * @access protected */ protected $PageBreakTrigger; /** * @var flag set when processing footer * @access protected */ protected $InFooter; /** * @var zoom display mode * @access protected */ protected $ZoomMode; /** * @var layout display mode * @access protected */ protected $LayoutMode; /** * @var title * @access protected */ protected $title; /** * @var subject * @access protected */ protected $subject; /** * @var author * @access protected */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -