32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-25 22:07:33 +00:00
This commit is contained in:
nicolaasuni 2009-09-23 19:10:28 +02:00
parent fc98ce157e
commit 6a3fdfa636
16 changed files with 525 additions and 348 deletions

View File

@ -1,3 +1,9 @@
4.8.006 (2009-09-23)
- Bug item #2864522 "No images if DOCUMENT_ROOT=='/'" was fixed.
- Support for text-indent CSS attribute was added.
- Method rollbackTransaction() was changed to support self-reassigment of previous object (check source code documentation).
- Support for the HTML "nobr" attribute was added to avoid splitting a table or a table row on two pages (i.e.: <tr nobr="true">...</tr>).
4.8.005 (2009-09-17)
- A bug relative to multiple transformations and annotations was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 4.8.005
Release date: 2009-09-17
Version: 4.8.006
Release date: 2009-09-23
Author: Nicola Asuni
Copyright (c) 2001-2009:

View File

@ -45,7 +45,7 @@
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:29 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

File diff suppressed because it is too large Load Diff

View File

@ -1368,7 +1368,7 @@ $type)</code>
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:29 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

View File

@ -96,7 +96,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:29 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

View File

@ -507,7 +507,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:36 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:20 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

View File

@ -88,7 +88,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:29 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

View File

@ -73,7 +73,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>4.8.005</td>
<td><b>version:</b>&nbsp;&nbsp;</td><td>4.8.006</td>
</tr>
<tr>
<td><b>copyright:</b>&nbsp;&nbsp;</td><td>2002-2009 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>
@ -104,7 +104,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 4.8.005 (http://www.tcpdf.org)'</code>
<code>PDF_PRODUCER = 'TCPDF 4.8.006 (http://www.tcpdf.org)'</code>
</td></tr></table>
</td></tr></table>
@ -115,7 +115,7 @@ unicode data<br /><br /></div>
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:30 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:15 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

View File

@ -237,7 +237,7 @@ Unicode Include file for TCPDF.<br /><br /><br /><br />
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:36 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:20 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

View File

@ -943,6 +943,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$sig_obj_id">TCPDF::$sig_obj_id</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Signature object ID</dd>
<dt><b>$spot_colors</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$spot_colors">TCPDF::$spot_colors</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Array of Spot colors</dd>
<dt><b>$start_transaction_page</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$start_transaction_page">TCPDF::$start_transaction_page</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Store page number when startTransaction() is called.</dd>
<dt><b>$state</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$state">TCPDF::$state</a></dd>
<dt><b>$subject</b></dt>
@ -962,9 +964,9 @@
<dt><b>SetAutoPageBreak</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetAutoPageBreak">TCPDF::SetAutoPageBreak()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodsetBarcode">TCPDFBarcode::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the barcode.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetBarcode">TCPDF::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set document barcode.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodsetBarcode">TCPDFBarcode::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the barcode.</dd>
<dt><b>SetBooklet</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetBooklet">TCPDF::SetBooklet()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the booklet mode for double-sided pages.</dd>
<dt><b>setBuffer</b></dt>
@ -1151,6 +1153,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$tempfontsize">TCPDF::$tempfontsize</a></dd>
<dt><b>$TextColor</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$TextColor">TCPDF::$TextColor</a></dd>
<dt><b>$textindent</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$textindent">TCPDF::$textindent</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Text indentation value (used for text-indent CSS attribute)</dd>
<dt><b>$thead</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$thead">TCPDF::$thead</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Table header content to be repeated on each new page</dd>
<dt><b>$theadMargins</b></dt>
@ -1436,7 +1440,7 @@
<a href="elementindex.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:29 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

View File

@ -1098,6 +1098,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$sig_obj_id">TCPDF::$sig_obj_id</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Signature object ID</dd>
<dt><b>$spot_colors</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$spot_colors">TCPDF::$spot_colors</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Array of Spot colors</dd>
<dt><b>$start_transaction_page</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$start_transaction_page">TCPDF::$start_transaction_page</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Store page number when startTransaction() is called.</dd>
<dt><b>$state</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$state">TCPDF::$state</a></dd>
<dt><b>$subject</b></dt>
@ -1117,9 +1119,9 @@
<dt><b>SetAutoPageBreak</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetAutoPageBreak">TCPDF::SetAutoPageBreak()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodsetBarcode">TCPDFBarcode::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the barcode.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodsetBarcode">TCPDF::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set document barcode.</dd>
<dt><b>setBarcode</b></dt>
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodsetBarcode">TCPDFBarcode::setBarcode()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the barcode.</dd>
<dt><b>SetBooklet</b></dt>
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodSetBooklet">TCPDF::SetBooklet()</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Set the booklet mode for double-sided pages.</dd>
<dt><b>setBuffer</b></dt>
@ -1306,6 +1308,8 @@
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$tempfontsize">TCPDF::$tempfontsize</a></dd>
<dt><b>$TextColor</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$TextColor">TCPDF::$TextColor</a></dd>
<dt><b>$textindent</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$textindent">TCPDF::$textindent</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Text indentation value (used for text-indent CSS attribute)</dd>
<dt><b>$thead</b></dt>
<dd>in file tcpdf.php, variable <a href="com-tecnick-tcpdf/TCPDF.html#var$thead">TCPDF::$thead</a><br>&nbsp;&nbsp;&nbsp;&nbsp;Table header content to be repeated on each new page</dd>
<dt><b>$theadMargins</b></dt>
@ -1459,7 +1463,7 @@
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:28 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

View File

@ -35,7 +35,7 @@
<a href="#Post-parsing">Post-parsing</a><br>
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:36 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:20 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

View File

@ -58,7 +58,7 @@
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.1</a><br />
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:29 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

View File

@ -58,7 +58,7 @@
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.1</a><br />
<div class="credit">
<hr />
Documentation generated on Thu, 17 Sep 2009 22:37:29 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
Documentation generated on Wed, 23 Sep 2009 19:10:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
</div>
</td></tr></table>
</td>

118
tcpdf.php
View File

@ -2,9 +2,9 @@
//============================================================+
// File name : tcpdf.php
// Begin : 2002-08-03
// Last Update : 2009-09-17
// Last Update : 2009-09-23
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
// Version : 4.8.005
// Version : 4.8.006
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// ----------------------------------------------------------------------------
// Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l.
@ -128,7 +128,7 @@
* @copyright 2002-2009 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 4.8.005
* @version 4.8.006
*/
/**
@ -152,14 +152,14 @@ if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
define('PDF_PRODUCER', 'TCPDF 4.8.005 (http://www.tcpdf.org)');
define('PDF_PRODUCER', 'TCPDF 4.8.006 (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 4.8.005
* @version 4.8.006
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@ -1465,6 +1465,20 @@ if (!class_exists('TCPDF', false)) {
*/
protected $radio_groups = array();
/**
* Text indentation value (used for text-indent CSS attribute)
* @access protected
* @since 4.8.006 (2009-09-23)
*/
protected $textindent = 0;
/**
* Store page number when startTransaction() is called.
* @access protected
* @since 4.8.006 (2009-09-23)
*/
protected $start_transaction_page = 0;
//------------------------------------------------------------
// METHODS
//------------------------------------------------------------
@ -12600,6 +12614,7 @@ if (!class_exists('TCPDF', false)) {
$dom[$key]['fgcolor'] = $this->fgcolor;
$dom[$key]['align'] = '';
$dom[$key]['listtype'] = '';
$dom[$key]['text-indent'] = 0;
$thead = false; // true when we are inside the THEAD tag
++$key;
$level = array();
@ -12652,7 +12667,7 @@ if (!class_exists('TCPDF', false)) {
$key = $i;
}
// store header rows on a new table
if (($dom[$key]['value'] == 'tr') AND ($dom[($dom[$key]['parent'])]['thead'] == true)) {
if (($dom[$key]['value'] == 'tr') AND ($dom[($dom[$key]['parent'])]['thead'] === true)) {
if ($this->empty_string($dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'])) {
$dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'] = $a[$dom[($dom[($dom[$key]['parent'])]['parent'])]['elkey']];
}
@ -12685,6 +12700,7 @@ if (!class_exists('TCPDF', false)) {
$dom[$key]['fgcolor'] = $dom[$parentkey]['fgcolor'];
$dom[$key]['align'] = $dom[$parentkey]['align'];
$dom[$key]['listtype'] = $dom[$parentkey]['listtype'];
$dom[$key]['text-indent'] = $dom[$parentkey]['text-indent'];
}
// get attributes
preg_match_all('/([^=\s]*)=["]?([^"]*)["]?/', $element, $attr_array, PREG_PATTERN_ORDER);
@ -12721,6 +12737,13 @@ if (!class_exists('TCPDF', false)) {
$dom[$key]['listtype'] = $dom[$parentkey]['listtype'];
}
}
// text-indent
if (isset($dom[$key]['style']['text-indent'])) {
$dom[$key]['text-indent'] = $this->getHTMLUnitToUnits($dom[$key]['style']['text-indent']);
if ($dom[$key]['text-indent'] == 'inherit') {
$dom[$key]['text-indent'] = $dom[$parentkey]['text-indent'];
}
}
// font size
if (isset($dom[$key]['style']['font-size'])) {
$fsize = trim($dom[$key]['style']['font-size']);
@ -12955,12 +12978,15 @@ if (!class_exists('TCPDF', false)) {
$curfontstyle = $this->FontStyle;
$curfontsize = $this->FontSizePt;
$this->newline = true;
$minstartliney = $this->y;
$yshift = 0;
$startlinepage = $this->page;
$minstartliney = $this->y;
$startlinex = $this->x;
$startliney = $this->y;
$yshift = 0;
$newline = true;
$loop = 0;
$curpos = 0;
$this_method_vars = array();
$blocktags = array('blockquote','br','dd','div','dt','h1','h2','h3','h4','h5','h6','hr','li','ol','p','ul','tcpdf');
$this->premode = false;
if (isset($this->PageAnnots[$this->page])) {
@ -12994,7 +13020,7 @@ if (!class_exists('TCPDF', false)) {
} else {
$this->listindent = $this->GetStringWidth('0000');
}
// save previous list state
// save previous states
$prev_listnum = $this->listnum;
$prev_listordered = $this->listordered;
$prev_listcount = $this->listcount;
@ -13011,6 +13037,47 @@ if (!class_exists('TCPDF', false)) {
$maxel = count($dom);
$key = 0;
while ($key < $maxel) {
if ($dom[$key]['tag'] AND $dom[$key]['opening'] AND isset($dom[$key]['attribute']['nobr']) AND ($dom[$key]['attribute']['nobr'] == 'true')) {
if (isset($dom[($dom[$key]['parent'])]['attribute']['nobr']) AND ($dom[($dom[$key]['parent'])]['attribute']['nobr'] == 'true')) {
$dom[$key]['attribute']['nobr'] = false;
} else {
// store current object
$this->startTransaction();
// save this method vars
$this_method_vars['html'] = $html;
$this_method_vars['ln'] = $ln;
$this_method_vars['fill'] = $fill;
$this_method_vars['reseth'] = $reseth;
$this_method_vars['cell'] = $cell;
$this_method_vars['align'] = $align;
$this_method_vars['gvars'] = $gvars;
$this_method_vars['prevPage'] = $prevPage;
$this_method_vars['prevlMargin'] = $prevlMargin;
$this_method_vars['prevrMargin'] = $prevrMargin;
$this_method_vars['curfontname'] = $curfontname;
$this_method_vars['curfontstyle'] = $curfontstyle;
$this_method_vars['curfontsize'] = $curfontsize;
$this_method_vars['minstartliney'] = $minstartliney;
$this_method_vars['yshift'] = $yshift;
$this_method_vars['startlinepage'] = $startlinepage;
$this_method_vars['startlinepos'] = $startlinepos;
$this_method_vars['startlinex'] = $startlinex;
$this_method_vars['startliney'] = $startliney;
$this_method_vars['newline'] = $newline;
$this_method_vars['loop'] = $loop;
$this_method_vars['curpos'] = $curpos;
$this_method_vars['pask'] = $pask;
$this_method_vars['lalign'] = $lalign;
$this_method_vars['plalign'] = $plalign;
$this_method_vars['w'] = $w;
$this_method_vars['prev_listnum'] = $prev_listnum;
$this_method_vars['prev_listordered'] = $prev_listordered;
$this_method_vars['prev_listcount'] = $prev_listcount;
$this_method_vars['prev_lispacer'] = $prev_lispacer;
$this_method_vars['key'] = $key;
$this_method_vars['dom'] = $dom;
}
}
if ($dom[$key]['tag'] OR ($key == 0)) {
if ((($dom[$key]['value'] == 'table') OR ($dom[$key]['value'] == 'tr')) AND (isset($dom[$key]['align']))) {
$dom[$key]['align'] = ($this->rtl) ? 'R' : 'L';
@ -13432,6 +13499,10 @@ if (!class_exists('TCPDF', false)) {
}
if ($dom[$key]['tag']) {
if ($dom[$key]['opening']) {
// get text indentation (if any)
if (isset($dom[$key]['text-indent']) AND in_array($dom[$key]['value'], array('blockquote','dd','div','dt','h1','h2','h3','h4','h5','h6','li','ol','p','ul','table','tr','td'))) {
$this->textindent = $dom[$key]['text-indent'];
}
if ($dom[$key]['value'] == 'table') {
if ($this->rtl) {
$wtmp = $this->x - $this->lMargin;
@ -13687,8 +13758,14 @@ if (!class_exists('TCPDF', false)) {
} else {
$ctmpmargin = $this->cMargin;
$this->cMargin = 0;
if ($this->rtl) {
$this->x -= $this->textindent;
} else {
$this->x += $this->textindent;
}
// ****** write only until the end of the line and get the rest ******
$strrest = $this->Write($this->lasth, $dom[$key]['value'], '', $wfill, '', false, 0, true, $firstblock);
$this->textindent = 0;
$this->cMargin = $ctmpmargin;
}
if (strlen($strrest) > 0) {
@ -13716,6 +13793,16 @@ if (!class_exists('TCPDF', false)) {
}
}
++$key;
if (isset($dom[$key]['tag']) AND $dom[$key]['tag'] AND (!isset($dom[$key]['opening']) OR !$dom[$key]['opening']) AND isset($dom[($dom[$key]['parent'])]['attribute']['nobr']) AND ($dom[($dom[$key]['parent'])]['attribute']['nobr'] == 'true') AND ($this->start_transaction_page < $this->numpages)) {
// restore previous object
$this->rollbackTransaction(true);
// restore previous values
foreach ($this_method_vars as $vkey => $vval) {
$$vkey = $vval;
}
// add a page
$this->AddPage();
}
} // end for each $key
// align the last line
if (isset($startlinex)) {
@ -13905,7 +13992,7 @@ if (!class_exists('TCPDF', false)) {
case 'img': {
if (isset($tag['attribute']['src'])) {
// replace relative path with real server path
if ($tag['attribute']['src'][0] == '/') {
if (($tag['attribute']['src'][0] == '/') AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
$tag['attribute']['src'] = $_SERVER['DOCUMENT_ROOT'].$tag['attribute']['src'];
}
$tag['attribute']['src'] = urldecode($tag['attribute']['src']);
@ -15855,6 +15942,8 @@ if (!class_exists('TCPDF', false)) {
// remove previous copy
$this->commitTransaction();
}
// record current page number
$this->start_transaction_page = $this->page;
// clone current object
$this->objcopy = $this->objclone($this);
}
@ -15873,11 +15962,12 @@ if (!class_exists('TCPDF', false)) {
/**
* This method allows to undo the latest transaction by returning the latest saved TCPDF object with startTransaction().
* @param boolean $self if true restores current class object to previous state without the need of reassignment via the returned value.
* @return TCPDF object.
* @access public
* @since 4.5.029 (2009-03-19)
*/
public function rollbackTransaction() {
public function rollbackTransaction($self=false) {
if (isset($this->objcopy)) {
if (isset($this->objcopy->diskcache) AND $this->objcopy->diskcache) {
// truncate files to previous values
@ -15888,6 +15978,12 @@ if (!class_exists('TCPDF', false)) {
}
}
$this->_destroy(true, true);
if ($self) {
$objvars = get_object_vars($this->objcopy);
foreach ($objvars as $key => $value) {
$this->$key = $value;
}
}
return $this->objcopy;
}
return $this;