diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT
index 6a217fe..8d2c83c 100755
--- a/CHANGELOG.TXT
+++ b/CHANGELOG.TXT
@@ -1,3 +1,10 @@
+5.9.151 (2012-03-22)
+ - Bug item #3509889 "Transform() distorts PDF" was fixed.
+ - Precision of real number were extended.
+ - ComboBox and ListBox methods were fixed.
+ - Bulgarian language file was added.
+ - addTOC() method was improved to include bookmark color and font style.
+
5.9.150 (2012-03-16)
- A bug related to form fields in PDF/A mode was fixed.
diff --git a/README.TXT b/README.TXT
index 379fe3f..68b47d5 100755
--- a/README.TXT
+++ b/README.TXT
@@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
-Version: 5.9.150
-Release date: 2012-03-16
+Version: 5.9.151
+Release date: 2012-03-22
Author: Nicola Asuni
Copyright (c) 2002-2012:
diff --git a/tcpdf.php b/tcpdf.php
index 8bc9451..fd0aa71 100755
--- a/tcpdf.php
+++ b/tcpdf.php
@@ -1,9 +1,9 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
- * @version 5.9.150
+ * @version 5.9.151
*/
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
@@ -149,7 +149,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php');
* 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.
* @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions.
- * @version 5.9.150
+ * @version 5.9.151
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF {
@@ -160,7 +160,7 @@ class TCPDF {
* Current TCPDF version.
* @private
*/
- private $tcpdf_version = '5.9.150';
+ private $tcpdf_version = '5.9.151';
// Protected properties
@@ -1941,7 +1941,7 @@ class TCPDF {
$this->setCellMargins(0, 0, 0, 0);
// line width (0.2 mm)
$this->LineWidth = 0.57 / $this->k;
- $this->linestyleWidth = sprintf('%.2F w', ($this->LineWidth * $this->k));
+ $this->linestyleWidth = sprintf('%F w', ($this->LineWidth * $this->k));
$this->linestyleCap = '0 J';
$this->linestyleJoin = '0 j';
$this->linestyleDash = '[] 0 d';
@@ -4503,19 +4503,19 @@ class TCPDF {
$pdfcolor = sprintf('/CS%d ', $this->spot_colors[$name]['i']);
switch ($type) {
case 'draw': {
- $pdfcolor .= sprintf('CS %.3F SCN', $tint);
+ $pdfcolor .= sprintf('CS %F SCN', $tint);
$this->DrawColor = $pdfcolor;
$this->strokecolor = $spotcolor;
break;
}
case 'fill': {
- $pdfcolor .= sprintf('cs %.3F scn', $tint);
+ $pdfcolor .= sprintf('cs %F scn', $tint);
$this->FillColor = $pdfcolor;
$this->bgcolor = $spotcolor;
break;
}
case 'text': {
- $pdfcolor .= sprintf('cs %.3F scn', $tint);
+ $pdfcolor .= sprintf('cs %F scn', $tint);
$this->TextColor = $pdfcolor;
$this->fgcolor = $spotcolor;
break;
@@ -4674,7 +4674,7 @@ class TCPDF {
// Grey scale
$col1 = max(0, min(255, $col1));
$intcolor = array('G' => $col1);
- $pdfcolor = sprintf('%.3F ', ($col1 / 255));
+ $pdfcolor = sprintf('%F ', ($col1 / 255));
$suffix = 'g';
} elseif ($col4 == -1) {
// RGB
@@ -4682,7 +4682,7 @@ class TCPDF {
$col2 = max(0, min(255, $col2));
$col3 = max(0, min(255, $col3));
$intcolor = array('R' => $col1, 'G' => $col2, 'B' => $col3);
- $pdfcolor = sprintf('%.3F %.3F %.3F ', ($col1 / 255), ($col2 / 255), ($col3 / 255));
+ $pdfcolor = sprintf('%F %F %F ', ($col1 / 255), ($col2 / 255), ($col3 / 255));
$suffix = 'rg';
} else {
$col1 = max(0, min(100, $col1));
@@ -4692,7 +4692,7 @@ class TCPDF {
if (empty($name)) {
// CMYK
$intcolor = array('C' => $col1, 'M' => $col2, 'Y' => $col3, 'K' => $col4);
- $pdfcolor = sprintf('%.3F %.3F %.3F %.3F ', ($col1 / 100), ($col2 / 100), ($col3 / 100), ($col4 / 100));
+ $pdfcolor = sprintf('%F %F %F %F ', ($col1 / 100), ($col2 / 100), ($col3 / 100), ($col4 / 100));
$suffix = 'k';
} else {
// SPOT COLOR
@@ -4744,17 +4744,17 @@ class TCPDF {
switch (count($c)) {
case 4: {
// CMYK
- $color .= sprintf('%.3F %.3F %.3F %.3F', (max(0, min(100, floatval($c[0]))) / 100), (max(0, min(100, floatval($c[1]))) / 100), (max(0, min(100, floatval($c[2]))) / 100), (max(0, min(100, floatval($c[3]))) / 100));
+ $color .= sprintf('%F %F %F %F', (max(0, min(100, floatval($c[0]))) / 100), (max(0, min(100, floatval($c[1]))) / 100), (max(0, min(100, floatval($c[2]))) / 100), (max(0, min(100, floatval($c[3]))) / 100));
break;
}
case 3: {
// RGB
- $color .= sprintf('%.3F %.3F %.3F', (max(0, min(255, floatval($c[0]))) / 255), (max(0, min(255, floatval($c[1]))) / 255), (max(0, min(255, floatval($c[2]))) / 255));
+ $color .= sprintf('%F %F %F', (max(0, min(255, floatval($c[0]))) / 255), (max(0, min(255, floatval($c[1]))) / 255), (max(0, min(255, floatval($c[2]))) / 255));
break;
}
case 1: {
// grayscale
- $color .= sprintf('%.3F', (max(0, min(255, floatval($c[0]))) / 255));
+ $color .= sprintf('%F', (max(0, min(255, floatval($c[0]))) / 255));
break;
}
}
@@ -5281,7 +5281,7 @@ class TCPDF {
$this->FontAscent = ($font_ascent / $this->k);
$this->FontDescent = ($font_descent / $this->k);
if ($out AND ($this->page > 0) AND (isset($this->CurrentFont['i']))) {
- $this->_out(sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
+ $this->_out(sprintf('BT /F%d %F Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
}
}
@@ -5854,7 +5854,7 @@ class TCPDF {
} else {
$xk = ($x * $k);
}
- $s .= sprintf('%.2F %.2F %.2F %.2F re %s ', $xk, (($this->h - $y) * $k), ($w * $k), (-$h * $k), $op);
+ $s .= sprintf('%F %F %F %F re %s ', $xk, (($this->h - $y) * $k), ($w * $k), (-$h * $k), $op);
}
// draw borders
$s .= $this->getCellBorder($x, $y, $w, $h, $border);
@@ -5927,17 +5927,17 @@ class TCPDF {
}
if ($this->font_stretching != 100) {
// apply font stretching
- $rs .= sprintf('BT %.2F Tz ET ', $this->font_stretching);
+ $rs .= sprintf('BT %F Tz ET ', $this->font_stretching);
}
if ($this->font_spacing != 0) {
// increase/decrease font spacing
- $rs .= sprintf('BT %.2F Tc ET ', ($this->font_spacing * $this->k));
+ $rs .= sprintf('BT %F Tc ET ', ($this->font_spacing * $this->k));
}
if ($this->ColorFlag AND ($this->textrendermode < 4)) {
$s .= 'q '.$this->TextColor.' ';
}
// rendering mode
- $s .= sprintf('BT %d Tr %.2F w ET ', $this->textrendermode, $this->textstrokewidth);
+ $s .= sprintf('BT %d Tr %F w ET ', $this->textrendermode, $this->textstrokewidth);
// count number of spaces
$ns = substr_count($txt, chr(32));
// Justification
@@ -5953,7 +5953,7 @@ class TCPDF {
$spacewidth /= ($this->font_stretching / 100);
}
// set word position to be used with TJ operator
- $txt2 = str_replace(chr(0).chr(32), ') '.sprintf('%.3F', $spacewidth).' (', $txt2);
+ $txt2 = str_replace(chr(0).chr(32), ') '.sprintf('%F', $spacewidth).' (', $txt2);
$unicode_justification = true;
} else {
// get string width
@@ -5965,7 +5965,7 @@ class TCPDF {
$spacewidth /= ($this->font_stretching / 100);
}
// set word spacing
- $rs .= sprintf('BT %.3F Tw ET ', $spacewidth);
+ $rs .= sprintf('BT %F Tw ET ', $spacewidth);
}
$width = $w - $this->cell_padding['L'] - $this->cell_padding['R'];
}
@@ -6009,7 +6009,7 @@ class TCPDF {
}
$xdk = $xdx * $k;
// print text
- $s .= sprintf('BT %.2F %.2F Td [(%s)] TJ ET', $xdk, (($this->h - $basefonty) * $k), $txt2);
+ $s .= sprintf('BT %F %F Td [(%s)] TJ ET', $xdk, (($this->h - $basefonty) * $k), $txt2);
if (isset($uniblock)) {
// print overlapping characters as separate string
$xshift = 0; // horizontal shift
@@ -6027,7 +6027,7 @@ class TCPDF {
// character to print
$topchr = $this->arrUTF8ToUTF16BE($uniarr, false);
$topchr = $this->_escape($topchr);
- $s .= sprintf(' BT %.2F %.2F Td [(%s)] TJ ET', ($xdk + ($xshift * $k)), $ty, $topchr);
+ $s .= sprintf(' BT %F %F Td [(%s)] TJ ET', ($xdk + ($xshift * $k)), $ty, $topchr);
}
}
}
@@ -6193,85 +6193,85 @@ class TCPDF {
}
// draw borders by case
if (strlen($border) == 4) {
- $s .= sprintf('%.2F %.2F %.2F %.2F re S ', $xT, $yT, ($w * $k), (-$h * $k));
+ $s .= sprintf('%F %F %F %F re S ', $xT, $yT, ($w * $k), (-$h * $k));
} elseif (strlen($border) == 3) {
if (strpos($border,'B') === false) { // LTR
- $s .= sprintf('%.2F %.2F m ', $xL, $yL);
- $s .= sprintf('%.2F %.2F l ', $xT, $yT);
- $s .= sprintf('%.2F %.2F l ', $xR, $yR);
- $s .= sprintf('%.2F %.2F l ', $xB, $yB);
+ $s .= sprintf('%F %F m ', $xL, $yL);
+ $s .= sprintf('%F %F l ', $xT, $yT);
+ $s .= sprintf('%F %F l ', $xR, $yR);
+ $s .= sprintf('%F %F l ', $xB, $yB);
$s .= 'S ';
} elseif (strpos($border,'L') === false) { // TRB
- $s .= sprintf('%.2F %.2F m ', $xT, $yT);
- $s .= sprintf('%.2F %.2F l ', $xR, $yR);
- $s .= sprintf('%.2F %.2F l ', $xB, $yB);
- $s .= sprintf('%.2F %.2F l ', $xL, $yL);
+ $s .= sprintf('%F %F m ', $xT, $yT);
+ $s .= sprintf('%F %F l ', $xR, $yR);
+ $s .= sprintf('%F %F l ', $xB, $yB);
+ $s .= sprintf('%F %F l ', $xL, $yL);
$s .= 'S ';
} elseif (strpos($border,'T') === false) { // RBL
- $s .= sprintf('%.2F %.2F m ', $xR, $yR);
- $s .= sprintf('%.2F %.2F l ', $xB, $yB);
- $s .= sprintf('%.2F %.2F l ', $xL, $yL);
- $s .= sprintf('%.2F %.2F l ', $xT, $yT);
+ $s .= sprintf('%F %F m ', $xR, $yR);
+ $s .= sprintf('%F %F l ', $xB, $yB);
+ $s .= sprintf('%F %F l ', $xL, $yL);
+ $s .= sprintf('%F %F l ', $xT, $yT);
$s .= 'S ';
} elseif (strpos($border,'R') === false) { // BLT
- $s .= sprintf('%.2F %.2F m ', $xB, $yB);
- $s .= sprintf('%.2F %.2F l ', $xL, $yL);
- $s .= sprintf('%.2F %.2F l ', $xT, $yT);
- $s .= sprintf('%.2F %.2F l ', $xR, $yR);
+ $s .= sprintf('%F %F m ', $xB, $yB);
+ $s .= sprintf('%F %F l ', $xL, $yL);
+ $s .= sprintf('%F %F l ', $xT, $yT);
+ $s .= sprintf('%F %F l ', $xR, $yR);
$s .= 'S ';
}
} elseif (strlen($border) == 2) {
if ((strpos($border,'L') !== false) AND (strpos($border,'T') !== false)) { // LT
- $s .= sprintf('%.2F %.2F m ', $xL, $yL);
- $s .= sprintf('%.2F %.2F l ', $xT, $yT);
- $s .= sprintf('%.2F %.2F l ', $xR, $yR);
+ $s .= sprintf('%F %F m ', $xL, $yL);
+ $s .= sprintf('%F %F l ', $xT, $yT);
+ $s .= sprintf('%F %F l ', $xR, $yR);
$s .= 'S ';
} elseif ((strpos($border,'T') !== false) AND (strpos($border,'R') !== false)) { // TR
- $s .= sprintf('%.2F %.2F m ', $xT, $yT);
- $s .= sprintf('%.2F %.2F l ', $xR, $yR);
- $s .= sprintf('%.2F %.2F l ', $xB, $yB);
+ $s .= sprintf('%F %F m ', $xT, $yT);
+ $s .= sprintf('%F %F l ', $xR, $yR);
+ $s .= sprintf('%F %F l ', $xB, $yB);
$s .= 'S ';
} elseif ((strpos($border,'R') !== false) AND (strpos($border,'B') !== false)) { // RB
- $s .= sprintf('%.2F %.2F m ', $xR, $yR);
- $s .= sprintf('%.2F %.2F l ', $xB, $yB);
- $s .= sprintf('%.2F %.2F l ', $xL, $yL);
+ $s .= sprintf('%F %F m ', $xR, $yR);
+ $s .= sprintf('%F %F l ', $xB, $yB);
+ $s .= sprintf('%F %F l ', $xL, $yL);
$s .= 'S ';
} elseif ((strpos($border,'B') !== false) AND (strpos($border,'L') !== false)) { // BL
- $s .= sprintf('%.2F %.2F m ', $xB, $yB);
- $s .= sprintf('%.2F %.2F l ', $xL, $yL);
- $s .= sprintf('%.2F %.2F l ', $xT, $yT);
+ $s .= sprintf('%F %F m ', $xB, $yB);
+ $s .= sprintf('%F %F l ', $xL, $yL);
+ $s .= sprintf('%F %F l ', $xT, $yT);
$s .= 'S ';
} elseif ((strpos($border,'L') !== false) AND (strpos($border,'R') !== false)) { // LR
- $s .= sprintf('%.2F %.2F m ', $xL, $yL);
- $s .= sprintf('%.2F %.2F l ', $xT, $yT);
+ $s .= sprintf('%F %F m ', $xL, $yL);
+ $s .= sprintf('%F %F l ', $xT, $yT);
$s .= 'S ';
- $s .= sprintf('%.2F %.2F m ', $xR, $yR);
- $s .= sprintf('%.2F %.2F l ', $xB, $yB);
+ $s .= sprintf('%F %F m ', $xR, $yR);
+ $s .= sprintf('%F %F l ', $xB, $yB);
$s .= 'S ';
} elseif ((strpos($border,'T') !== false) AND (strpos($border,'B') !== false)) { // TB
- $s .= sprintf('%.2F %.2F m ', $xT, $yT);
- $s .= sprintf('%.2F %.2F l ', $xR, $yR);
+ $s .= sprintf('%F %F m ', $xT, $yT);
+ $s .= sprintf('%F %F l ', $xR, $yR);
$s .= 'S ';
- $s .= sprintf('%.2F %.2F m ', $xB, $yB);
- $s .= sprintf('%.2F %.2F l ', $xL, $yL);
+ $s .= sprintf('%F %F m ', $xB, $yB);
+ $s .= sprintf('%F %F l ', $xL, $yL);
$s .= 'S ';
}
} else { // strlen($border) == 1
if (strpos($border,'L') !== false) { // L
- $s .= sprintf('%.2F %.2F m ', $xL, $yL);
- $s .= sprintf('%.2F %.2F l ', $xT, $yT);
+ $s .= sprintf('%F %F m ', $xL, $yL);
+ $s .= sprintf('%F %F l ', $xT, $yT);
$s .= 'S ';
} elseif (strpos($border,'T') !== false) { // T
- $s .= sprintf('%.2F %.2F m ', $xT, $yT);
- $s .= sprintf('%.2F %.2F l ', $xR, $yR);
+ $s .= sprintf('%F %F m ', $xT, $yT);
+ $s .= sprintf('%F %F l ', $xR, $yR);
$s .= 'S ';
} elseif (strpos($border,'R') !== false) { // R
- $s .= sprintf('%.2F %.2F m ', $xR, $yR);
- $s .= sprintf('%.2F %.2F l ', $xB, $yB);
+ $s .= sprintf('%F %F m ', $xR, $yR);
+ $s .= sprintf('%F %F l ', $xB, $yB);
$s .= 'S ';
} elseif (strpos($border,'B') !== false) { // B
- $s .= sprintf('%.2F %.2F m ', $xB, $yB);
- $s .= sprintf('%.2F %.2F l ', $xL, $yL);
+ $s .= sprintf('%F %F m ', $xB, $yB);
+ $s .= sprintf('%F %F l ', $xL, $yL);
$s .= 'S ';
}
}
@@ -7755,7 +7755,7 @@ class TCPDF {
$tmp = array();
if (preg_match('/[\s]+width[\s]*=[\s]*"([^"]*)"/si', $svgtag, $tmp)) {
$ow = $this->getHTMLUnitToUnits($tmp[1], 1, $this->svgunit, false);
- $owu = sprintf('%.3F', ($ow * $dpi / 72)).$this->pdfunit;
+ $owu = sprintf('%F', ($ow * $dpi / 72)).$this->pdfunit;
$svgtag = preg_replace('/[\s]+width[\s]*=[\s]*"[^"]*"/si', ' width="'.$owu.'"', $svgtag, 1);
} else {
$ow = $w;
@@ -7763,7 +7763,7 @@ class TCPDF {
$tmp = array();
if (preg_match('/[\s]+height[\s]*=[\s]*"([^"]*)"/si', $svgtag, $tmp)) {
$oh = $this->getHTMLUnitToUnits($tmp[1], 1, $this->svgunit, false);
- $ohu = sprintf('%.3F', ($oh * $dpi / 72)).$this->pdfunit;
+ $ohu = sprintf('%F', ($oh * $dpi / 72)).$this->pdfunit;
$svgtag = preg_replace('/[\s]+height[\s]*=[\s]*"[^"]*"/si', ' height="'.$ohu.'"', $svgtag, 1);
} else {
$oh = $h;
@@ -7772,7 +7772,7 @@ class TCPDF {
if (!preg_match('/[\s]+viewBox[\s]*=[\s]*"[\s]*([0-9\.]+)[\s]+([0-9\.]+)[\s]+([0-9\.]+)[\s]+([0-9\.]+)[\s]*"/si', $svgtag, $tmp)) {
$vbw = ($ow * $this->imgscale * $this->k);
$vbh = ($oh * $this->imgscale * $this->k);
- $vbox = sprintf(' viewBox="0 0 %.3F %.3F" ', $vbw, $vbh);
+ $vbox = sprintf(' viewBox="0 0 %F %F" ', $vbw, $vbh);
$svgtag = $vbox.$svgtag;
}
$svgimg = preg_replace('/