⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcpdf.php

📁 简介:一个用PHP编写的
💻 PHP
📖 第 1 页 / 共 5 页
字号:
		/**		* @var right-bottom corner X coordinate of inserted image		* @since 2002-07-31		* @author Nicola Asuni		* @access protected		*/		var $img_rb_x;		/**		* @var right-bottom corner Y coordinate of inserted image		* @since 2002-07-31		* @author Nicola Asuni		* @access protected		*/		var $img_rb_y;		/**		* @var image scale factor		* @since 2004-06-14		* @author Nicola Asuni		* @access protected		*/		var $imgscale = 1;		/**		* @var boolean set to true when the input text is unicode (require unicode fonts)		* @since 2005-01-02		* @author Nicola Asuni		* @access protected		*/		var $isunicode = false;		/**		* @var PDF version		* @since 1.5.3		* @access protected		*/		var $PDFVersion = "1.3";						// ----------------------				/**		 * @var Minimum distance between header and top page margin.		 * @access private		 */		var $header_margin;				/**		 * @var Minimum distance between footer and bottom page margin.		 * @access private		 */		var $footer_margin;				/**		 * @var original left margin value		 * @access private		 * @since 1.53.0.TC013		 */		var $original_lMargin;				/**		 * @var original right margin value		 * @access private		 * @since 1.53.0.TC013		 */		var $original_rMargin;					/**		 * @var Header font.		 * @access private		 */		var $header_font;				/**		 * @var Footer font.		 * @access private		 */		var $footer_font;				/**		 * @var Language templates.		 * @access private		 */		var $l;				/**		 * @var Barcode to print on page footer (only if set).		 * @access private		 */		var $barcode = false;				/**		 * @var If true prints header		 * @access private		 */		var $print_header = true;				/**		 * @var If true prints footer.		 * @access private		 */		var $print_footer = true;				/**		 * @var Header width (0 = full page width).		 * @access private		 */		var $header_width = 0;				/**		 * @var Header image logo.		 * @access private		 */		var $header_logo = "";				/**		 * @var Header image logo width in mm.		 * @access private		 */		var $header_logo_width = 30;				/**		 * @var String to print as title on document header.		 * @access private		 */		var $header_title = "";				/**		 * @var String to print on document header.		 * @access private		 */		var $header_string = "";				/**		 * @var Default number of columns for html table.		 * @access private		 */		var $default_table_columns = 4;						// variables for html parser				/**		 * @var HTML PARSER: store current link.		 * @access private		 */		var $HREF;				/**		 * @var HTML PARSER: store font list.		 * @access private		 */		var $fontList;				/**		 * @var HTML PARSER: true when font attribute is set.		 * @access private		 */		var $issetfont;				/**		 * @var HTML PARSER: true when color attribute is set.		 * @access private		 */		var $issetcolor;				/**		 * @var HTML PARSER: true in case of ordered list (OL), false otherwise.		 * @access private		 */		var $listordered = false;				/**		 * @var HTML PARSER: count list items.		 * @access private		 */		var $listcount = 0;				/**		 * @var HTML PARSER: size of table border.		 * @access private		 */		var $tableborder = 0;				/**		 * @var HTML PARSER: true at the beginning of table.		 * @access private		 */		var $tdbegin = false;				/**		 * @var HTML PARSER: table width.		 * @access private		 */		var $tdwidth = 0;				/**		 * @var HTML PARSER: table height.		 * @access private		 */		var $tdheight = 0;				/**		 * @var HTML PARSER: table align.		 * @access private		 */		var $tdalign = "L";				/**		 * @var HTML PARSER: table background color.		 * @access private		 */		var $tdbgcolor = false;				/**		 * @var Store temporary font size in points.		 * @access private		 */		var $tempfontsize = 10;				/**		 * @var Bold font style status.		 * @access private		 */		var $b;				/**		 * @var Underlined font style status.		 * @access private		 */		var $u;				/**		 * @var Italic font style status.		 * @access private		 */		var $i;				/**		 * @var spacer for LI tags.		 * @access private		 */		var $lispacer = "";				/**		 * @var default encoding		 * @access private		 * @since 1.53.0.TC010		 */		var $encoding = "UTF-8";				/**		 * @var PHP internal encoding		 * @access private		 * @since 1.53.0.TC016		 */		var $internal_encoding;				/**		 * @var store previous fill color as RGB array		 * @access private		 * @since 1.53.0.TC017		 */		var $prevFillColor = array(255,255,255);				/**		 * @var store previous text color as RGB array		 * @access private		 * @since 1.53.0.TC017		 */		var $prevTextColor = array(0,0,0);				/**		 * @var store previous font family		 * @access private		 * @since 1.53.0.TC017		 */		var $prevFontFamily;				/**		 * @var store previous font style		 * @access private		 * @since 1.53.0.TC017		 */		var $prevFontStyle;		//------------------------------------------------------------		// var methods		//------------------------------------------------------------		/**		 * This is the class constructor. 		 * It allows to set up the page format, the orientation and 		 * the measure unit used in all the methods (except for the font sizes).		 * @since 1.0		 * @param string $orientation page orientation. Possible values are (case insensitive):<ul><li>P or Portrait (default)</li><li>L or Landscape</li></ul>		 * @param string $unit User measure unit. Possible values are:<ul><li>pt: point</li><li>mm: millimeter (default)</li><li>cm: centimeter</li><li>in: inch</li></ul><br />A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit.		 * @param mixed $format The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit).<ul><li>4A0</li><li>2A0</li><li>A0</li><li>A1</li><li>A2</li><li>A3</li><li>A4 (default)</li><li>A5</li><li>A6</li><li>A7</li><li>A8</li><li>A9</li><li>A10</li><li>B0</li><li>B1</li><li>B2</li><li>B3</li><li>B4</li><li>B5</li><li>B6</li><li>B7</li><li>B8</li><li>B9</li><li>B10</li><li>C0</li><li>C1</li><li>C2</li><li>C3</li><li>C4</li><li>C5</li><li>C6</li><li>C7</li><li>C8</li><li>C9</li><li>C10</li><li>RA0</li><li>RA1</li><li>RA2</li><li>RA3</li><li>RA4</li><li>SRA0</li><li>SRA1</li><li>SRA2</li><li>SRA3</li><li>SRA4</li><li>LETTER</li><li>LEGAL</li><li>EXECUTIVE</li><li>FOLIO</li></ul>		 * @param boolean $unicode TRUE means that the input text is unicode (default = true)		 * @param String $encoding charset encoding; default is UTF-8		 */		function TCPDF($orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding="UTF-8") {						/* Set internal character encoding to ASCII */			if (function_exists("mb_internal_encoding") AND mb_internal_encoding()) {				$this->internal_encoding = mb_internal_encoding();				mb_internal_encoding("ASCII");			}							//Some checks			$this->_dochecks();			//Initialization of properties			$this->isunicode=$unicode;			$this->page=0;			$this->n=2;			$this->buffer='';			$this->pages=array();			$this->OrientationChanges=array();			$this->state=0;			$this->fonts=array();			$this->FontFiles=array();			$this->diffs=array();			$this->images=array();			$this->links=array();			$this->InFooter=false;			$this->lasth=0;			$this->FontFamily='';			$this->FontStyle='';			$this->FontSizePt=12;			$this->underline=false;			$this->DrawColor='0 G';			$this->FillColor='0 g';			$this->TextColor='0 g';			$this->ColorFlag=false;			$this->ws=0;			//Standard Unicode fonts			$this->CoreFonts=array(			'courier'=>'Courier',			'courierB'=>'Courier-Bold',			'courierI'=>'Courier-Oblique',			'courierBI'=>'Courier-BoldOblique',			'helvetica'=>'Helvetica',			'helveticaB'=>'Helvetica-Bold',			'helveticaI'=>'Helvetica-Oblique',			'helveticaBI'=>'Helvetica-BoldOblique',			'times'=>'Times-Roman',			'timesB'=>'Times-Bold',			'timesI'=>'Times-Italic',			'timesBI'=>'Times-BoldItalic',			'symbol'=>'Symbol',			'zapfdingbats'=>'ZapfDingbats'			);			//Scale factor			// 2003-06-11 - Nicola Asuni : changed if/else with switch statement			switch (strtolower($unit)){				case 'pt': {$this->k=1; break;}				case 'mm': {$this->k=72/25.4; break;}				case 'cm': {$this->k=72/2.54; break;}				case 'in': {$this->k=72; break;}				default : {$this->Error('Incorrect unit: '.$unit); break;}			}			//Page format			if(is_string($format)) {				// 2002-07-24 - Nicola Asuni (info@tecnick.com)				// Added new page formats (45 standard ISO paper formats and 4 american common formats).				// Paper cordinates are calculated in this way: (inches * 72) where (1 inch = 2.54 cm)				switch (strtoupper($format)){					case '4A0': {$format = array(4767.87,6740.79); break;}					case '2A0': {$format = array(3370.39,4767.87); break;}					case 'A0': {$format = array(2383.94,3370.39); break;}					case 'A1': {$format = array(1683.78,2383.94); break;}					case 'A2': {$format = array(1190.55,1683.78); break;}					case 'A3': {$format = array(841.89,1190.55); break;}					case 'A4': default: {$format = array(595.28,841.89); break;}					case 'A5': {$format = array(419.53,595.28); break;}					case 'A6': {$format = array(297.64,419.53); break;}					case 'A7': {$format = array(209.76,297.64); break;}					case 'A8': {$format = array(147.40,209.76); break;}					case 'A9': {$format = array(104.88,147.40); break;}					case 'A10': {$format = array(73.70,104.88); break;}					case 'B0': {$format = array(2834.65,4008.19); break;}					case 'B1': {$format = array(2004.09,2834.65); break;}					case 'B2': {$format = array(1417.32,2004.09); break;}					case 'B3': {$format = array(1000.63,1417.32); break;}					case 'B4': {$format = array(708.66,1000.63); break;}					case 'B5': {$format = array(498.90,708.66); break;}					case 'B6': {$format = array(354.33,498.90); break;}					case 'B7': {$format = array(249.45,354.33); break;}					case 'B8': {$format = array(175.75,249.45); break;}					case 'B9': {$format = array(124.72,175.75); break;}					case 'B10': {$format = array(87.87,124.72); break;}					case 'C0': {$format = array(2599.37,3676.54); break;}					case 'C1': {$format = array(1836.85,2599.37); break;}					case 'C2': {$format = array(1298.27,1836.85); break;}					case 'C3': {$format = array(918.43,1298.27); break;}					case 'C4': {$format = array(649.13,918.43); break;}					case 'C5': {$format = array(459.21,649.13); break;}					case 'C6': {$format = array(323.15,459.21); break;}					case 'C7': {$format = array(229.61,323.15); break;}					case 'C8': {$format = array(161.57,229.61); break;}					case 'C9': {$format = array(113.39,161.57); break;}					case 'C10': {$format = array(79.37,113.39); break;}					case 'RA0': {$format = array(2437.80,3458.27); break;}					case 'RA1': {$format = array(1729.13,2437.80); break;}					case 'RA2': {$format = array(1218.90,1729.13); break;}					case 'RA3': {$format = array(864.57,1218.90); break;}					case 'RA4': {$format = array(609.45,864.57); break;}					case 'SRA0': {$format = array(2551.18,3628.35); break;}					case 'SRA1': {$format = array(1814.17,2551.18); break;}					case 'SRA2': {$format = array(1275.59,1814.17); break;}					case 'SRA3': {$format = array(907.09,1275.59); break;}					case 'SRA4': {$format = array(637.80,907.09); break;}					case 'LETTER': {$format = array(612.00,792.00); break;}					case 'LEGAL': {$format = array(612.00,1008.00); break;}					case 'EXECUTIVE': {$format = array(521.86,756.00); break;}					case 'FOLIO': {$format = array(612.00,936.00); break;}					// default: {$this->Error('Unknown page format: '.$format); break;}					// END CHANGES Nicola Asuni				}				$this->fwPt=$format[0];				$this->fhPt=$format[1];			}			else {				$this->fwPt=$format[0]*$this->k;				$this->fhPt=$format[1]*$this->k;			}			$this->fw=$this->fwPt/$this->k;			$this->fh=$this->fhPt/$this->k;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -