32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-22 12:55:10 +00:00
This commit is contained in:
nicolaasuni 2010-05-14 12:43:33 +02:00
parent 72cc22e6d7
commit 5c22d6a76d
20 changed files with 426 additions and 413 deletions

View File

@ -1,3 +1,7 @@
5.0.007 (2010-05-14)
- Bug #3001347 "Bug when using WriteHTML with setEqualColumns()" was fixed.
- Bug #3001505 "problem with sup and sub tags at the beginning of a line" was fixed.
5.0.006 (2010-05-13)
- Length of hr tag was fixed.
- An error on 2d barcode method was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 5.0.006
Release date: 2010-05-13
Version: 5.0.007
Release date: 2010-05-14
Author: Nicola Asuni
Copyright (c) 2001-2010:

View File

@ -55,7 +55,7 @@
<div class="credit">
<hr />
Documentation generated on Thu, 13 May 2010 17:40:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +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, 13 May 2010 17:40:31 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +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, 13 May 2010 17:40:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +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, 13 May 2010 17:40:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +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, 13 May 2010 17:40:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +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, 13 May 2010 17:40:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -539,7 +539,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Thu, 13 May 2010 17:40:34 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:27 +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, 13 May 2010 17:40:31 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +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, 13 May 2010 17:40:31 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +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>5.0.006</td>
<td><b>version:</b>&nbsp;&nbsp;</td><td>5.0.007</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 5.0.006 (http://www.tcpdf.org)'</code>
<code>PDF_PRODUCER = 'TCPDF 5.0.007 (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, 13 May 2010 17:40:31 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:24 +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, 13 May 2010 17:40:34 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:27 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1946,7 +1946,7 @@
<a href="elementindex.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Thu, 13 May 2010 17:40:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -1975,7 +1975,7 @@
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Thu, 13 May 2010 17:40:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

View File

@ -37,14 +37,14 @@
<a name="tcpdf.php"></a>
<h1>tcpdf.php</h1>
<h2>Warnings:</h2><br>
<b>Warning on line 18053</b> - Unknown tag "@parma" used<br>
<b>Warning on line 18062</b> - Unknown tag "@parma" used<br>
<a name="2dbarcodes.php"></a>
<h1>2dbarcodes.php</h1>
<h2>Errors:</h2><br>
<b>Error on line 79</b> - Text cannot be outside of li tag in a DocBlock list, parsing will be incorrect<br>
<div class="credit">
<hr />
Documentation generated on Thu, 13 May 2010 17:40:34 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:27 +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, 13 May 2010 17:40:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +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, 13 May 2010 17:40:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
Documentation generated on Fri, 14 May 2010 12:43:23 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>

251
tcpdf.php
View File

@ -2,9 +2,9 @@
//============================================================+
// File name : tcpdf.php
// Begin : 2002-08-03
// Last Update : 2010-05-13
// Last Update : 2010-05-14
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
// Version : 5.0.006
// Version : 5.0.007
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// ----------------------------------------------------------------------------
// Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l.
@ -122,7 +122,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 5.0.006
* @version 5.0.007
*/
/**
@ -146,14 +146,14 @@ if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
define('PDF_PRODUCER', 'TCPDF 5.0.006 (http://www.tcpdf.org)');
define('PDF_PRODUCER', 'TCPDF 5.0.007 (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 5.0.006
* @version 5.0.007
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@ -776,14 +776,14 @@ if (!class_exists('TCPDF', false)) {
* @access protected
*/
protected $enc_padding = "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A";
/**
* File ID (used on trailer)
* @access protected
* @since 5.0.005 (2010-05-12)
*/
protected $file_id;
protected $file_id;
// --- bookmark ---
/**
@ -4904,7 +4904,6 @@ if (!class_exists('TCPDF', false)) {
$shy = false;
// account for margin changes
if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND (!$this->InFooter)) {
// AcceptPageBreak() may be overriden on extended classed to include margin changes
$this->AcceptPageBreak();
}
$w = $this->getRemainingWidth();
@ -5046,7 +5045,6 @@ if (!class_exists('TCPDF', false)) {
}
// account for margin changes
if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND (!$this->InFooter)) {
// AcceptPageBreak() may be overriden on extended classed to include margin changes
$this->AcceptPageBreak();
}
$w = $this->getRemainingWidth();
@ -8691,7 +8689,7 @@ if (!class_exists('TCPDF', false)) {
$objkey .= "\x73\x41\x6C\x54";
}
$objkey = substr($this->_md5_16($objkey), 0, (($this->encryptdata['Length'] / 8) + 5));
$objkey = substr($objkey, 0, 16);
$objkey = substr($objkey, 0, 16);
return $objkey;
}
@ -8849,7 +8847,7 @@ if (!class_exists('TCPDF', false)) {
protected function _RC4($key, $text) {
if (function_exists('mcrypt_decrypt') AND ($out = @mcrypt_decrypt(@MCRYPT_ARCFOUR, $key, $text, @MCRYPT_MODE_STREAM))) {
// try to use mcrypt function if exist
return $out;
return $out;
}
if ($this->last_enc_key != $key) {
$k = str_repeat($key, ((256 / strlen($key)) + 1));
@ -8896,10 +8894,10 @@ if (!class_exists('TCPDF', false)) {
// padding (RFC 2898, PKCS #5: Password-Based Cryptography Specification Version 2.0)
$padding = 16 - (strlen($text) % 16);
$text .= str_repeat(chr($padding), $padding);
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND);
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND);
$text = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $text, MCRYPT_MODE_CBC, $iv);
$text = $iv.$text;
return $text;
$text = $iv.$text;
return $text;
}
/**
@ -9044,7 +9042,7 @@ if (!class_exists('TCPDF', false)) {
$hexsignature = current(unpack('H*', $signature));
// store signature on recipients array
$this->encryptdata['Recipients'][] = $hexsignature;
// The bytes of each item in the Recipients array of PKCS#7 objects in the order in which they appear in the array
// The bytes of each item in the Recipients array of PKCS#7 objects in the order in which they appear in the array
$recipient_bytes .= $signature;
}
// calculate encryption key
@ -13065,9 +13063,9 @@ if (!class_exists('TCPDF', false)) {
$lastcols = $num_cols - 1;
for ($i = 1; $i < $num_cols; ++$i) {
$functions .= ($fc + $i).' 0 R ';
if ($i < $lastcols) {
if ($i < $lastcols) {
$bounds .= sprintf('%.3F ', $grad['colors'][$i]['offset']);
}
}
$encode .= '0 1 ';
}
$out .= ' /Functions ['.trim($functions).']';
@ -15334,12 +15332,19 @@ if (!class_exists('TCPDF', false)) {
$this->y -= $yshift;
}
}
$this->newline = false;
$pre_y = $this->y;
$pbrk = $this->checkPageBreak($this->lasth);
$this->newline = false;
$startlinex = $this->x;
$startliney = $this->y;
$minstartliney = $startliney;
$maxbottomliney = ($this->y + (($fontsize * $this->cell_height_ratio) / $this->k));
if ($dom[$dom[$key]['parent']]['value'] == 'sup') {
$startliney -= ((0.3 * $this->FontSizePt) / $this->k);
} elseif ($dom[$dom[$key]['parent']]['value'] == 'sub') {
$startliney -= (($this->FontSizePt / 0.7) / $this->k);
} else {
$minstartliney = $startliney;
$maxbottomliney = ($this->y + (($fontsize * $this->cell_height_ratio) / $this->k));
}
$startlinepage = $this->page;
if (isset($endlinepos) AND (!$pbrk)) {
$startlinepos = $endlinepos;
@ -15646,7 +15651,6 @@ if (!class_exists('TCPDF', false)) {
$strrest = $this->Write($this->lasth, $dom[$key]['value'], '', $wfill, '', false, 0, true, $firstblock, 0);
}
$this->textindent = 0;
if (strlen($strrest) > 0) {
// store the remaining string on the previous $key position
$this->newline = true;
@ -16999,6 +17003,7 @@ if (!class_exists('TCPDF', false)) {
$retval = ($value * $refsize);
break;
}
// height of lower case 'x' (about half the font-size)
case 'ex': {
$retval = $value * ($refsize / 2);
break;
@ -17008,23 +17013,27 @@ if (!class_exists('TCPDF', false)) {
$retval = ($value * $this->dpi) / $k;
break;
}
// centimeters
case 'cm': {
$retval = ($value / 2.54 * $this->dpi) / $k;
break;
}
// millimeters
case 'mm': {
$retval = ($value / 25.4 * $this->dpi) / $k;
break;
}
// one pica is 12 points
case 'pc': {
// one pica is 12 points
$retval = ($value * 12) / $k;
break;
}
// points
case 'pt': {
$retval = $value / $k;
break;
}
// pixels
case 'px': {
$retval = $this->pixelsToUnits($value);
break;
@ -18904,22 +18913,22 @@ if (!class_exists('TCPDF', false)) {
$e = $ox * $this->k * (1 - $svgscale_x);
$f = ($this->h - $oy) * $this->k * (1 - $svgscale_y);
$this->_out(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F cm', $svgscale_x, 0, 0, $svgscale_y, $e + $svgoffset_x, $f + $svgoffset_y));
// creates a new XML parser to be used by the other XML functions
$this->parser = xml_parser_create('UTF-8');
// the following function allows to use parser inside object
xml_set_object($this->parser, $this);
// disable case-folding for this XML parser
xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
// sets the element handler functions for the XML parser
// creates a new XML parser to be used by the other XML functions
$this->parser = xml_parser_create('UTF-8');
// the following function allows to use parser inside object
xml_set_object($this->parser, $this);
// disable case-folding for this XML parser
xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
// sets the element handler functions for the XML parser
xml_set_element_handler($this->parser, 'startSVGElementHandler', 'endSVGElementHandler');
// sets the character data handler function for the XML parser
xml_set_character_data_handler($this->parser, 'segSVGContentHandler');
// start parsing an XML document
if(!xml_parse($this->parser, $svgdata)) {
// sets the character data handler function for the XML parser
xml_set_character_data_handler($this->parser, 'segSVGContentHandler');
// start parsing an XML document
if(!xml_parse($this->parser, $svgdata)) {
$error_message = sprintf("SVG Error: %s at line %d", xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser));
$this->Error($error_message);
}
// free this XML parser
$this->Error($error_message);
}
// free this XML parser
xml_parser_free($this->parser);
// restore previous graphic state
$this->_out($this->epsmarker.'Q');
@ -18968,14 +18977,14 @@ if (!class_exists('TCPDF', false)) {
$this->endlinex = $this->img_rb_x;
}
/**
* Get the tranformation matrix from SVG transform attribute
* @param string transformation
* @return array of transformations
/**
* Get the tranformation matrix from SVG transform attribute
* @param string transformation
* @return array of transformations
* @author Nicola Asuni
* @since 5.0.000 (2010-05-02)
* @access protected
*/
* @access protected
*/
protected function getSVGTransformMatrix($attribute) {
// identity matrix
$tm = array(1, 0, 0, 1, 0, 0);
@ -19071,15 +19080,15 @@ if (!class_exists('TCPDF', false)) {
return $tm;
}
/**
* Get the product of two SVG tranformation matrices
/**
* Get the product of two SVG tranformation matrices
* @param array $ta first SVG tranformation matrix
* @param array $tb second SVG tranformation matrix
* @return transformation array
* @param array $tb second SVG tranformation matrix
* @return transformation array
* @author Nicola Asuni
* @since 5.0.000 (2010-05-02)
* @access protected
*/
* @access protected
*/
protected function getTransformationMatrixProduct($ta, $tb) {
$tm = array();
$tm[0] = ($ta[0] * $tb[0]) + ($ta[2] * $tb[1]);
@ -19122,8 +19131,8 @@ if (!class_exists('TCPDF', false)) {
$this->Transform($this->convertSVGtMatrix($tm));
}
/**
* Apply the requested SVG styles (*** TO BE COMPLETED ***)
/**
* Apply the requested SVG styles (*** TO BE COMPLETED ***)
* @param array $svgstyle array of SVG styles to apply
* @param array $prevsvgstyle array of previous SVG style
* @param int $x X origin of the bounding box
@ -19132,11 +19141,11 @@ if (!class_exists('TCPDF', false)) {
* @param int $h height of the bounding box
* @param string $clip_function clip function
* @param array $clip_params array of parameters for clipping function
* @return object style
* @return object style
* @author Nicola Asuni
* @since 5.0.000 (2010-05-02)
* @access protected
*/
* @access protected
*/
protected function setSVGStyles($svgstyle, $prevsvgstyle, $x=0, $y=0, $w=1, $h=1, $clip_function='', $clip_params=array()) {
$objstyle = '';
if(!isset($svgstyle['opacity'])) {
@ -19375,8 +19384,8 @@ if (!class_exists('TCPDF', false)) {
return $objstyle;
}
/**
* Draws an SVG path
/**
* Draws an SVG path
* @param string $d attribute d of the path SVG element
* @param string $style Style of rendering. Possible values are:
* <ul>
@ -19388,11 +19397,11 @@ if (!class_exists('TCPDF', false)) {
* <li>CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).</li>
* <li>CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).</li>
* </ul>
* @return array of container box measures (x, y, w, h)
* @return array of container box measures (x, y, w, h)
* @author Nicola Asuni
* @since 5.0.000 (2010-05-02)
* @access protected
*/
* @access protected
*/
protected function SVGPath($d, $style='') {
// set fill/stroke style
$op = $this->getPathPaintOperator($style, '');
@ -19701,16 +19710,16 @@ if (!class_exists('TCPDF', false)) {
return array($xmin, $ymin, ($xmax - $xmin), ($ymax - $ymin));
}
/**
* Returns the angle in radiants between two vectors
/**
* Returns the angle in radiants between two vectors
* @param int $x1 X coordiante of first vector point
* @param int $y1 Y coordiante of first vector point
* @param int $x2 X coordiante of second vector point
* @param int $y2 Y coordiante of second vector point
* @param int $y2 Y coordiante of second vector point
* @author Nicola Asuni
* @since 5.0.000 (2010-05-04)
* @access protected
*/
* @access protected
*/
protected function getVectorsAngle($x1, $y1, $x2, $y2) {
$dprod = ($x1 * $x2) + ($y1 * $y2);
$dist1 = sqrt(($x1 * $x1) + ($y1 * $y1));
@ -19725,15 +19734,15 @@ if (!class_exists('TCPDF', false)) {
return $angle;
}
/**
* Sets the opening SVG element handler function for the XML parser. (*** TO BE COMPLETED ***)
* @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler.
* @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters.
* @param array $attribs The third parameter, attribs, contains an associative array with the element's attributes (if any). The keys of this array are the attribute names, the values are the attribute values. Attribute names are case-folded on the same criteria as element names. Attribute values are not case-folded. The original order of the attributes can be retrieved by walking through attribs the normal way, using each(). The first key in the array was the first attribute, and so on.
/**
* Sets the opening SVG element handler function for the XML parser. (*** TO BE COMPLETED ***)
* @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler.
* @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters.
* @param array $attribs The third parameter, attribs, contains an associative array with the element's attributes (if any). The keys of this array are the attribute names, the values are the attribute values. Attribute names are case-folded on the same criteria as element names. Attribute values are not case-folded. The original order of the attributes can be retrieved by walking through attribs the normal way, using each(). The first key in the array was the first attribute, and so on.
* @author Nicola Asuni
* @since 5.0.000 (2010-05-02)
* @access protected
*/
* @access protected
*/
protected function startSVGElementHandler($parser, $name, $attribs) {
// check if we are in clip mode
if ($this->svgclipmode) {
@ -19750,7 +19759,7 @@ if (!class_exists('TCPDF', false)) {
$clipping = true;
}
// get styling properties
$prev_svgstyle = $this->svgstyles[(count($this->svgstyles) - 1)]; // previous style
$prev_svgstyle = $this->svgstyles[(count($this->svgstyles) - 1)]; // previous style
$svgstyle = array(); // current style
if (isset($attribs['style'])) {
$attribs['style'] = ';'.$attribs['style'];
@ -19792,10 +19801,10 @@ if (!class_exists('TCPDF', false)) {
}
$svgstyle['transfmatrix'] = $tm;
// process tag
switch($name) {
case 'defs': {
$this->svgdefsmode = true;
break;
switch($name) {
case 'defs': {
$this->svgdefsmode = true;
break;
}
// clipPath
case 'clipPath': {
@ -19804,16 +19813,16 @@ if (!class_exists('TCPDF', false)) {
$this->svgclippaths[$this->svgclipid] = array();
break;
}
case 'svg': {
// start of SVG object
break;
}
case 'g': {
// group together related graphics elements
case 'svg': {
// start of SVG object
break;
}
case 'g': {
// group together related graphics elements
array_push($this->svgstyles, $svgstyle);
$this->StartTransform();
$this->setSVGStyles($svgstyle, $prev_svgstyle);
break;
$this->setSVGStyles($svgstyle, $prev_svgstyle);
break;
}
case 'linearGradient': {
$this->svggradientid = $attribs['id'];
@ -20110,26 +20119,26 @@ if (!class_exists('TCPDF', false)) {
$this->startSVGElementHandler($parser, $use['name'], $use['attribs']);
}
break;
}
default: {
break;
}
}
}
/**
* Sets the closing SVG element handler function for the XML parser.
* @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler.
* @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters.
}
default: {
break;
}
}
}
/**
* Sets the closing SVG element handler function for the XML parser.
* @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler.
* @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters.
* @author Nicola Asuni
* @since 5.0.000 (2010-05-02)
* @access protected
*/
protected function endSVGElementHandler($parser, $name) {
* @access protected
*/
protected function endSVGElementHandler($parser, $name) {
switch($name) {
case 'defs': {
$this->svgdefsmode = false;
break;
case 'defs': {
$this->svgdefsmode = false;
break;
}
// clipPath
case 'clipPath': {
@ -20137,34 +20146,34 @@ if (!class_exists('TCPDF', false)) {
break;
}
case 'g': {
// ungroup: remove last style from array
// ungroup: remove last style from array
array_pop($this->svgstyles);
$this->StopTransform();
break;
$this->StopTransform();
break;
}
case 'text':
case 'tspan': {
case 'tspan': {
// print text
$this->Cell(0, 0, trim($this->svgtext), 0, 0, '', 0, '', 0, false, 'L', 'T');
$this->StopTransform();
break;
}
default: {
break;
}
}
$this->StopTransform();
break;
}
default: {
break;
}
}
}
/**
* Sets the character data handler function for the XML parser.
* @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler.
* @param string $data The second parameter, data, contains the character data as a string.
/**
* Sets the character data handler function for the XML parser.
* @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler.
* @param string $data The second parameter, data, contains the character data as a string.
* @author Nicola Asuni
* @since 5.0.000 (2010-05-02)
* @access protected
*/
protected function segSVGContentHandler($parser, $data) {
$this->svgtext .= $data;
* @access protected
*/
protected function segSVGContentHandler($parser, $data) {
$this->svgtext .= $data;
}
} // END OF TCPDF CLASS