@@ -6505,7 +6505,7 @@ $k)
- method addTOC [line 15906]
+ method addTOC [line 15944]
@@ -7445,7 +7445,7 @@ $h)
- method closeHTMLTagHandler [line 14546]
+ method closeHTMLTagHandler [line 14584]
@@ -7583,7 +7583,7 @@ $js = false])
- method commitTransaction [line 16065]
+ method commitTransaction [line 16103]
@@ -7854,7 +7854,7 @@ $fill_color = array()])
- method deletePage [line 15765]
+ method deletePage [line 15803]
@@ -8013,7 +8013,7 @@ $afinish:)
- method empty_string [line 16119]
+ method empty_string [line 16157]
@@ -8547,7 +8547,7 @@ $pagenum = ''])
- method getBuffer [line 15451]
+ method getBuffer [line 15489]
@@ -8744,7 +8744,7 @@ $char)
- method getFontBuffer [line 15611]
+ method getFontBuffer [line 15649]
@@ -9058,7 +9058,7 @@ $v)
- method getGraphicVars [line 15319]
+ method getGraphicVars [line 15357]
@@ -9268,7 +9268,7 @@ $html)
- method getHTMLUnitToUnits [line 15038]
+ method getHTMLUnitToUnits [line 15076]
@@ -9334,7 +9334,7 @@ $point)
- method getImageBuffer [line 15553]
+ method getImageBuffer [line 15591]
@@ -9680,7 +9680,7 @@ $w = 0])
- method getObjFilename [line 15383]
+ method getObjFilename [line 15421]
@@ -9790,7 +9790,7 @@ $prefix)
- method getPageBuffer [line 15494]
+ method getPageBuffer [line 15532]
@@ -10748,7 +10748,7 @@ $script)
- method intToRoman [line 15112]
+ method intToRoman [line 15150]
@@ -11394,7 +11394,7 @@ $y = ''])
- method movePage [line 15628]
+ method movePage [line 15666]
@@ -11568,7 +11568,7 @@ $maxh = 0])
- method objclone [line 16108]
+ method objclone [line 16146]
@@ -11641,7 +11641,7 @@ $object)
- method openHTMLTagHandler [line 14009]
+ method openHTMLTagHandler [line 14047]
@@ -12150,7 +12150,7 @@ $closed)
- method putHtmlListBullet [line 15177]
+ method putHtmlListBullet [line 15215]
@@ -12363,7 +12363,7 @@ $js = false])
- method readDiskCache [line 15423]
+ method readDiskCache [line 15461]
@@ -12693,7 +12693,7 @@ $length)
- method rollbackTransaction [line 16079]
+ method rollbackTransaction [line 16117]
@@ -13266,7 +13266,7 @@ $bc = ''])
- method SetBooklet [line 14952]
+ method SetBooklet [line 14990]
@@ -13317,7 +13317,7 @@ $outer = -1])
- method setBuffer [line 15433]
+ method setBuffer [line 15471]
@@ -14076,7 +14076,7 @@ $fontfile = ''])
- method setFontBuffer [line 15569]
+ method setFontBuffer [line 15607]
@@ -14163,7 +14163,7 @@ $size)
- method setFontSubBuffer [line 15591]
+ method setFontSubBuffer [line 15629]
@@ -14353,7 +14353,7 @@ $prop = array()])
- method setGraphicVars [line 15350]
+ method setGraphicVars [line 15388]
@@ -14549,7 +14549,7 @@ $hm = 10])
- method setHtmlLinksStyle [line 15023]
+ method setHtmlLinksStyle [line 15061]
@@ -14594,7 +14594,7 @@ $fontstyle = 'U'])
- method setHtmlVSpace [line 14992]
+ method setHtmlVSpace [line 15030]
@@ -14633,7 +14633,7 @@ $tagvs)
- method setImageBuffer [line 15510]
+ method setImageBuffer [line 15548]
@@ -14720,7 +14720,7 @@ $scale)
- method setImageSubBuffer [line 15533]
+ method setImageSubBuffer [line 15571]
@@ -15114,7 +15114,7 @@ $page = -1])
- method setListIndentWidth [line 15002]
+ method setListIndentWidth [line 15040]
@@ -15153,7 +15153,7 @@ $width)
- method setLIsymbol [line 14912]
+ method setLIsymbol [line 14950]
@@ -15246,7 +15246,7 @@ $right = -1])
- method setOpenCell [line 15012]
+ method setOpenCell [line 15050]
@@ -15333,7 +15333,7 @@ $resetmargins = false])
- method setPageBuffer [line 15467]
+ method setPageBuffer [line 15505]
@@ -16935,7 +16935,7 @@ $page = ''])
- method startTransaction [line 16049]
+ method startTransaction [line 16087]
@@ -17025,7 +17025,7 @@ $page = ''])
- method swapMargins [line 14968]
+ method swapMargins [line 15006]
@@ -18243,7 +18243,7 @@ $code)
- method writeDiskCache [line 15395]
+ method writeDiskCache [line 15433]
@@ -20764,7 +20764,7 @@ $file)
|
|
diff --git a/doc/com-tecnick-tcpdf/TCPDFBarcode.html b/doc/com-tecnick-tcpdf/TCPDFBarcode.html
index db8fe7d..5c7eca7 100644
--- a/doc/com-tecnick-tcpdf/TCPDFBarcode.html
+++ b/doc/com-tecnick-tcpdf/TCPDFBarcode.html
@@ -1368,7 +1368,7 @@ $type)
|
diff --git a/doc/com-tecnick-tcpdf/_barcodes.php.html b/doc/com-tecnick-tcpdf/_barcodes.php.html
index 62e2154..59cb2c8 100644
--- a/doc/com-tecnick-tcpdf/_barcodes.php.html
+++ b/doc/com-tecnick-tcpdf/_barcodes.php.html
@@ -96,7 +96,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
|
diff --git a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html
index 31ee775..8777138 100644
--- a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html
+++ b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html
@@ -507,7 +507,7 @@ Configuration file for TCPDF.
|
diff --git a/doc/com-tecnick-tcpdf/_htmlcolors.php.html b/doc/com-tecnick-tcpdf/_htmlcolors.php.html
index 500ce76..b10b65d 100644
--- a/doc/com-tecnick-tcpdf/_htmlcolors.php.html
+++ b/doc/com-tecnick-tcpdf/_htmlcolors.php.html
@@ -88,7 +88,7 @@ Array of WEB safe colors.
|
diff --git a/doc/com-tecnick-tcpdf/_tcpdf.php.html b/doc/com-tecnick-tcpdf/_tcpdf.php.html
index 0b97c45..0ec3b01 100644
--- a/doc/com-tecnick-tcpdf/_tcpdf.php.html
+++ b/doc/com-tecnick-tcpdf/_tcpdf.php.html
@@ -73,7 +73,7 @@ This is a PHP class for generating PDF documents without requiring external exte
author: | Nicola Asuni |
- version: | 4.8.014 |
+ version: | 4.8.015 |
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 |
@@ -104,7 +104,7 @@ unicode data
|
diff --git a/doc/com-tecnick-tcpdf/_unicode_data.php.html b/doc/com-tecnick-tcpdf/_unicode_data.php.html
index 2335990..428c334 100644
--- a/doc/com-tecnick-tcpdf/_unicode_data.php.html
+++ b/doc/com-tecnick-tcpdf/_unicode_data.php.html
@@ -237,7 +237,7 @@ Unicode Include file for TCPDF.
|
diff --git a/doc/elementindex.html b/doc/elementindex.html
index 32b798d..3342f51 100644
--- a/doc/elementindex.html
+++ b/doc/elementindex.html
@@ -1446,7 +1446,7 @@
top
|
diff --git a/doc/elementindex_com-tecnick-tcpdf.html b/doc/elementindex_com-tecnick-tcpdf.html
index 8f61414..774fbbc 100644
--- a/doc/elementindex_com-tecnick-tcpdf.html
+++ b/doc/elementindex_com-tecnick-tcpdf.html
@@ -1469,7 +1469,7 @@
top
|
diff --git a/doc/errors.html b/doc/errors.html
index 37b1a55..f7f5e65 100644
--- a/doc/errors.html
+++ b/doc/errors.html
@@ -35,7 +35,7 @@
Post-parsing
|
diff --git a/doc/index.html b/doc/index.html
index e0e6851..1b3617f 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -58,7 +58,7 @@
This documentation was generated by phpDocumentor v1.4.3
|
diff --git a/doc/li_com-tecnick-tcpdf.html b/doc/li_com-tecnick-tcpdf.html
index e0e6851..1b3617f 100644
--- a/doc/li_com-tecnick-tcpdf.html
+++ b/doc/li_com-tecnick-tcpdf.html
@@ -58,7 +58,7 @@
This documentation was generated by phpDocumentor v1.4.3
|
diff --git a/tcpdf.php b/tcpdf.php
index cbed80c..57cd1b0 100755
--- a/tcpdf.php
+++ b/tcpdf.php
@@ -2,9 +2,9 @@
//============================================================+
// File name : tcpdf.php
// Begin : 2002-08-03
-// Last Update : 2009-11-04
+// Last Update : 2009-11-20
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
-// Version : 4.8.014
+// Version : 4.8.015
// 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.014
+ * @version 4.8.015
*/
/**
@@ -152,14 +152,14 @@ if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
- define('PDF_PRODUCER', 'TCPDF 4.8.014 (http://www.tcpdf.org)');
+ define('PDF_PRODUCER', 'TCPDF 4.8.015 (http://www.tcpdf.org)');
/**
* This is a PHP class for generating PDF documents without requiring external extensions.
* 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.
* @name TCPDF
* @package com.tecnick.tcpdf
- * @version 4.8.014
+ * @version 4.8.015
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@@ -3737,7 +3737,8 @@ if (!class_exists('TCPDF', false)) {
$w = $this->w - $this->rMargin - $this->x;
}
}
- $s = '';
+ $s = '';
+ // fill and borders
if (($fill == 1) OR ($border == 1)) {
if ($fill == 1) {
$op = ($border == 1) ? 'B' : 'f';
@@ -3821,38 +3822,10 @@ if (!class_exists('TCPDF', false)) {
} else {
$stretch == 0;
}
- if ($align == 'L') {
- if ($this->rtl) {
- $dx = $w - $width - $this->cMargin;
- } else {
- $dx = $this->cMargin;
- }
- } elseif ($align == 'R') {
- if ($this->rtl) {
- $dx = $this->cMargin;
- } else {
- $dx = $w - $width - $this->cMargin;
- }
- } elseif ($align == 'C') {
- $dx = ($w - $width) / 2;
- } elseif ($align == 'J') {
- if ($this->rtl) {
- $dx = $w - $width - $this->cMargin;
- } else {
- $dx = $this->cMargin;
- }
- } else {
- $dx = $this->cMargin;
- }
if ($this->ColorFlag) {
$s .= 'q '.$this->TextColor.' ';
}
$txt2 = $this->_escapetext($txt);
- if ($this->rtl) {
- $xdk = ($this->x - $dx - $width) * $k;
- } else {
- $xdk = ($this->x + $dx) * $k;
- }
// Justification
if ($align == 'J') {
// count number of spaces
@@ -3870,17 +3843,44 @@ if (!class_exists('TCPDF', false)) {
$spacewidth = (($w - $width - (2 * $this->cMargin)) / ($ns?$ns:1)) * $this->k;
$rs .= sprintf('BT %.3F Tw ET ', $spacewidth);
}
+ $width = $w - (2 * $this->cMargin);
}
+ switch ($align) {
+ case 'C': {
+ $dx = ($w - $width) / 2;
+ break;
+ }
+ case 'R': {
+ if ($this->rtl) {
+ $dx = $this->cMargin;
+ } else {
+ $dx = $w - $width - $this->cMargin;
+ }
+ break;
+ }
+ case 'L':
+ case 'J':
+ default: {
+ if ($this->rtl) {
+ $dx = $w - $width - $this->cMargin;
+ } else {
+ $dx = $this->cMargin;
+ }
+ break;
+ }
+ }
+ if ($this->rtl) {
+ $xdx = $this->x - $dx - $width;
+ } else {
+ $xdx = $this->x + $dx;
+
+ }
+ $xdk = $xdx * $k;
// calculate approximate position of the font base line
//$basefonty = $this->y + (($h + $this->FontAscent - $this->FontDescent)/2);
$basefonty = $this->y + ($h/2) + ($this->FontSize/3);
// print text
$s .= sprintf('BT %.2F %.2F Td [(%s)] TJ ET', $xdk, (($this->h - $basefonty) * $k), $txt2);
- if ($this->rtl) {
- $xdx = $this->x - $dx - $width;
- } else {
- $xdx = $this->x + $dx;
- }
if ($this->underline) {
$s .= ' '.$this->_dounderlinew($xdx, $basefonty, $width);
}
@@ -5885,7 +5885,7 @@ if (!class_exists('TCPDF', false)) {
$annots .= ' /S /S';
}
if (isset($pl['opt']['be']['i']) AND ($pl['opt']['be']['i'] >= 0) AND ($pl['opt']['be']['i'] <= 2)) {
- $annots .= ' /I '.sprintf(" %.4F", $pl['opt']['be']['i']);
+ $annots .= ' /I '.sprintf(' %.4F', $pl['opt']['be']['i']);
}
$annots .= '>>';
}
@@ -5894,7 +5894,7 @@ if (!class_exists('TCPDF', false)) {
foreach ($pl['opt']['c'] as $col) {
$col = intval($col);
$color = $col <= 0 ? 0 : ($col >= 255 ? 1 : $col / 255);
- $annots .= sprintf(" %.4F", $color);
+ $annots .= sprintf(' %.4F', $color);
}
$annots .= ']';
}
@@ -5908,7 +5908,7 @@ if (!class_exists('TCPDF', false)) {
}
//$annots .= ' /Popup ';
if (isset($pl['opt']['ca'])) {
- $annots .= ' /CA '.sprintf("%.4F", floatval($pl['opt']['ca']));
+ $annots .= ' /CA '.sprintf('%.4F', floatval($pl['opt']['ca']));
}
if (isset($pl['opt']['rc'])) {
$annots .= ' /RC '.$this->_textstring($pl['opt']['rc']);
@@ -5992,7 +5992,7 @@ if (!class_exists('TCPDF', false)) {
if (isset($pl['opt']['cl']) AND is_array($pl['opt']['cl'])) {
$annots .= ' /CL [';
foreach ($pl['opt']['cl'] as $cl) {
- $annots .= sprintf("%.4F ", $cl * $this->k);
+ $annots .= sprintf('%.4F ', $cl * $this->k);
}
$annots .= ']';
}
@@ -6733,7 +6733,7 @@ if (!class_exists('TCPDF', false)) {
$this->_out('/Subtype /Image');
$this->_out('/Width '.$info['w']);
$this->_out('/Height '.$info['h']);
- if (isset($info['masked'])) {
+ if (array_key_exists('masked', $info)) {
$this->_out('/SMask '.($this->n - 1).' 0 R');
}
if ($info['cs'] == 'Indexed') {
@@ -8411,13 +8411,13 @@ if (!class_exists('TCPDF', false)) {
if ($i) {
$dash_string .= ' ';
}
- $dash_string .= sprintf("%.2F", $v);
+ $dash_string .= sprintf('%.2F', $v);
}
}
if (!isset($phase) OR !$dash) {
$phase = 0;
}
- $this->linestyleDash = sprintf("[%s] %.2F d", $dash_string, $phase);
+ $this->linestyleDash = sprintf('[%s] %.2F d', $dash_string, $phase);
$this->_out($this->linestyleDash);
}
if (isset($color)) {
@@ -8436,7 +8436,7 @@ if (!class_exists('TCPDF', false)) {
if ($this->rtl) {
$x = $this->w - $x;
}
- $this->_out(sprintf("%.2F %.2F m", $x * $this->k, ($this->h - $y) * $this->k));
+ $this->_out(sprintf('%.2F %.2F m', $x * $this->k, ($this->h - $y) * $this->k));
}
/*
@@ -8450,7 +8450,7 @@ if (!class_exists('TCPDF', false)) {
if ($this->rtl) {
$x = $this->w - $x;
}
- $this->_out(sprintf("%.2F %.2F l", $x * $this->k, ($this->h - $y) * $this->k));
+ $this->_out(sprintf('%.2F %.2F l', $x * $this->k, ($this->h - $y) * $this->k));
}
/**
@@ -8467,7 +8467,7 @@ if (!class_exists('TCPDF', false)) {
if ($this->rtl) {
$x = $this->w - $x - $w;
}
- $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s', $x*$this->k, ($this->h-$y)*$this->k, $w*$this->k, -$h*$this->k, $op));
+ $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s', $x * $this->k, ($this->h - $y) * $this->k, $w * $this->k, -$h * $this->k, $op));
}
/*
@@ -8488,7 +8488,7 @@ if (!class_exists('TCPDF', false)) {
$x2 = $this->w - $x2;
$x3 = $this->w - $x3;
}
- $this->_out(sprintf("%.2F %.2F %.2F %.2F %.2F %.2F c", $x1 * $this->k, ($this->h - $y1) * $this->k, $x2 * $this->k, ($this->h - $y2) * $this->k, $x3 * $this->k, ($this->h - $y3) * $this->k));
+ $this->_out(sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c', $x1 * $this->k, ($this->h - $y1) * $this->k, $x2 * $this->k, ($this->h - $y2) * $this->k, $x3 * $this->k, ($this->h - $y3) * $this->k));
}
/**
@@ -9908,10 +9908,10 @@ if (!class_exists('TCPDF', false)) {
$outline_y = array();
foreach ($this->outlines as $key => $row) {
$outline_p[$key] = $row['p'];
- $outline_y[$key] = $row['p'];
+ $outline_k[$key] = $key;
}
- // sort outlines by page and y position
- array_multisort($outline_p, SORT_NUMERIC, SORT_ASC, $outline_y, SORT_NUMERIC, SORT_ASC, $this->outlines);
+ // sort outlines by page and original position
+ array_multisort($outline_p, SORT_NUMERIC, SORT_ASC, $outline_k, SORT_NUMERIC, SORT_ASC, $this->outlines);
$lru = array();
$level = 0;
foreach ($this->outlines as $i => $o) {
@@ -13382,6 +13382,7 @@ if (!class_exists('TCPDF', false)) {
if ($this->isRTLTextDir()) {
$t_x = $this->lMargin - $this->endlinex;
}
+ $one_space_width = $this->GetStringWidth(chr(32));
$no = 0;
$ns = 0;
$pmidtemp = $pmid;
@@ -13404,15 +13405,20 @@ if (!class_exists('TCPDF', false)) {
} else {
$tvalue = $lnstring[1][$kk];
}
- // count spaces on line
- $no += substr_count($lnstring[1][$kk], chr(32));
- $ns += substr_count($tvalue, chr(32));
+ // store number of spaces on the strings
+ $lnstring[2][$kk] = substr_count($lnstring[1][$kk], chr(32));
+ $lnstring[3][$kk] = substr_count($tvalue, chr(32));
+ // count total spaces on line
+ $no += $lnstring[2][$kk];
+ $ns += $lnstring[3][$kk];
+ $lnstring[4][$kk] = $no;
+ $lnstring[5][$kk] = $ns;
}
if ($this->isRTLTextDir()) {
- $t_x = $this->lMargin - $this->endlinex - (($no - $ns - 1) * $this->GetStringWidth(chr(32)));
+ $t_x = $this->lMargin - $this->endlinex - (($no - $ns - 1) * $one_space_width);
}
// calculate additional space to add to each space
- $spacelen = $this->GetStringWidth(chr(32));
+ $spacelen = $one_space_width;
$spacewidth = (($tw - $linew + (($no - $ns) * $spacelen)) / ($ns?$ns:1)) * $this->k;
$spacewidthu = -1000 * ($tw - $linew + ($no * $spacelen)) / ($ns?$ns:1) / $this->FontSize;
$nsmax = $ns;
@@ -13421,6 +13427,10 @@ if (!class_exists('TCPDF', false)) {
$offset = 0;
$strcount = 0;
$prev_epsposbeg = 0;
+ $textpos = 0;
+ if ($this->isRTLTextDir()) {
+ $textpos = $this->wPt;
+ }
global $spacew;
while (preg_match('/([0-9\.\+\-]*)[\s](Td|cm|m|l|c|re)[\s]/x', $pmid, $strpiece, PREG_OFFSET_CAPTURE, $offset) == 1) {
// check if we are inside a string section '[( ... )]'
@@ -13467,6 +13477,7 @@ if (!class_exists('TCPDF', false)) {
// get current X position
preg_match('/([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s]('.$strpiece[2][0].')([\s]*)/x', $pmid, $xmatches);
$currentxpos = $xmatches[1];
+ $textpos = $currentxpos;
if (($strcount <= $maxkk) AND ($strpiece[2][0] == 'Td')) {
if ($strcount == $maxkk) {
if ($this->isRTLTextDir()) {
@@ -13491,22 +13502,49 @@ if (!class_exists('TCPDF', false)) {
break;
}
case 're': {
- // get current X position
- preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s]('.$strpiece[2][0].')([\s]*)/x', $pmid, $xmatches);
- $currentxpos = $xmatches[1];
// justify block
- $pmid = preg_replace_callback('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s]('.$strpiece[2][0].')([\s]*)/x',
- create_function('$matches', 'global $spacew;
- $newx = sprintf("%.2F",(floatval($matches[1]) + $spacew));
- return "".$newx." ".$matches[2]." ".$matches[3]." ".$matches[4]." x*#!#*x".$matches[5].$matches[6];'), $pmid, 1);
+ preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x', $pmid, $xmatches);
+ $currentxpos = $xmatches[1];
+ $x_diff = 0;
+ $w_diff = 0;
+ if ($this->isRTLTextDir()) { // RTL
+ if ($currentxpos < $textpos) {
+ $x_diff = ($spacewidth * ($nsmax - $lnstring[5][$strcount]));
+ $w_diff = ($spacewidth * $lnstring[3][$strcount]);
+ } else {
+ if ($strcount > 0) {
+ $x_diff = ($spacewidth * ($nsmax - $lnstring[5][($strcount - 1)]));
+ $w_diff = ($spacewidth * $lnstring[3][($strcount - 1)]);
+ }
+ }
+ } else { // LTR
+ if ($currentxpos > $textpos) {
+ if ($strcount > 0) {
+ $x_diff = ($spacewidth * $lnstring[4][($strcount - 1)]);
+ }
+ $w_diff = ($spacewidth * $lnstring[3][$strcount]);
+ } else {
+ if ($strcount > 1) {
+ $x_diff = ($spacewidth * $lnstring[4][($strcount - 2)]);
+ }
+ if ($strcount > 0) {
+ $w_diff = ($spacewidth * $lnstring[3][($strcount - 1)]);
+ }
+ }
+ }
+ $pmid = preg_replace_callback('/('.$xmatches[1].')[\s]('.$xmatches[2].')[\s]('.$xmatches[3].')[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x',
+ create_function('$matches', '
+ $newx = sprintf("%.2F",(floatval($matches[1]) + '.$x_diff.'));
+ $neww = sprintf("%.2F",(floatval($matches[3]) + '.$w_diff.'));
+ return "".$newx." ".$matches[2]." ".$neww." ".$matches[4]." x*#!#*x".$matches[5].$matches[6];'), $pmid, 1);
break;
}
case 'c': {
// get current X position
- preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s]('.$strpiece[2][0].')([\s]*)/x', $pmid, $xmatches);
+ preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](c)([\s]*)/x', $pmid, $xmatches);
$currentxpos = $xmatches[1];
// justify block
- $pmid = preg_replace_callback('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s]('.$strpiece[2][0].')([\s]*)/x',
+ $pmid = preg_replace_callback('/('.$xmatches[1].')[\s]('.$xmatches[2].')[\s]('.$xmatches[3].')[\s]('.$xmatches[4].')[\s]('.$xmatches[5].')[\s]('.$strpiece[1][0].')[\s](c)([\s]*)/x',
create_function('$matches', 'global $spacew;
$newx1 = sprintf("%.3F",(floatval($matches[1]) + $spacew));
$newx2 = sprintf("%.3F",(floatval($matches[3]) + $spacew));
@@ -13544,7 +13582,7 @@ if (!class_exists('TCPDF', false)) {
$endlinepos = strlen($pstart."\n".$pmid."\n");
} else {
// non-unicode (single-byte characters)
- $rs = sprintf("%.3F Tw", $spacewidth);
+ $rs = sprintf('%.3F Tw', $spacewidth);
$pmid = preg_replace("/\[\(/x", $rs.' [(', $pmid);
$this->setPageBuffer($startlinepage, $pstart."\n".$pmid."\nBT 0 Tw ET\n".$pend);
$endlinepos = strlen($pstart."\n".$pmid."\nBT 0 Tw ET\n");
@@ -15231,7 +15269,7 @@ if (!class_exists('TCPDF', false)) {
break;
}
case 'decimal-leading-zero': {
- $textitem = sprintf("%02d", $this->listcount[$this->listnum]);
+ $textitem = sprintf('%02d', $this->listcount[$this->listnum]);
break;
}
case 'i':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|