@@ -6561,7 +6561,7 @@ $k)
- method addTOC [line 16143]
+ method addTOC [line 16169]
@@ -7519,7 +7519,7 @@ $h)
- method closeHTMLTagHandler [line 14766]
+ method closeHTMLTagHandler [line 14792]
@@ -7663,7 +7663,7 @@ $js = false])
- method commitTransaction [line 16301]
+ method commitTransaction [line 16327]
@@ -7934,7 +7934,7 @@ $fill_color = array()])
- method deletePage [line 16001]
+ method deletePage [line 16027]
@@ -8093,7 +8093,7 @@ $afinish:)
- method empty_string [line 16355]
+ method empty_string [line 16381]
@@ -8642,7 +8642,7 @@ $pagenum = ''])
- method getBuffer [line 15687]
+ method getBuffer [line 15713]
@@ -8842,7 +8842,7 @@ $char)
- method getFontBuffer [line 15847]
+ method getFontBuffer [line 15873]
@@ -9165,7 +9165,7 @@ $v)
- method getGraphicVars [line 15555]
+ method getGraphicVars [line 15581]
@@ -9381,7 +9381,7 @@ $html)
- method getHTMLUnitToUnits [line 15274]
+ method getHTMLUnitToUnits [line 15300]
@@ -9447,7 +9447,7 @@ $point)
- method getImageBuffer [line 15789]
+ method getImageBuffer [line 15815]
@@ -9835,7 +9835,7 @@ $w = 0])
- method getObjFilename [line 15619]
+ method getObjFilename [line 15645]
@@ -9945,7 +9945,7 @@ $prefix)
- method getPageBuffer [line 15730]
+ method getPageBuffer [line 15756]
@@ -10958,7 +10958,7 @@ $script)
- method intToRoman [line 15348]
+ method intToRoman [line 15374]
@@ -11610,7 +11610,7 @@ $y = ''])
- method movePage [line 15864]
+ method movePage [line 15890]
@@ -11784,7 +11784,7 @@ $maxh = 0])
- method objclone [line 16344]
+ method objclone [line 16370]
@@ -11857,7 +11857,7 @@ $object)
- method openHTMLTagHandler [line 14221]
+ method openHTMLTagHandler [line 14246]
@@ -12366,7 +12366,7 @@ $closed)
- method putHtmlListBullet [line 15413]
+ method putHtmlListBullet [line 15439]
@@ -12585,7 +12585,7 @@ $js = false])
- method readDiskCache [line 15659]
+ method readDiskCache [line 15685]
@@ -12915,7 +12915,7 @@ $length)
- method rollbackTransaction [line 16315]
+ method rollbackTransaction [line 16341]
@@ -13491,7 +13491,7 @@ $bc = ''])
- method SetBooklet [line 15188]
+ method SetBooklet [line 15214]
@@ -13542,7 +13542,7 @@ $outer = -1])
- method setBuffer [line 15669]
+ method setBuffer [line 15695]
@@ -14310,7 +14310,7 @@ $fontfile = ''])
- method setFontBuffer [line 15805]
+ method setFontBuffer [line 15831]
@@ -14397,7 +14397,7 @@ $size)
- method setFontSubBuffer [line 15827]
+ method setFontSubBuffer [line 15853]
@@ -14593,7 +14593,7 @@ $prop = array()])
- method setGraphicVars [line 15586]
+ method setGraphicVars [line 15612]
@@ -14789,7 +14789,7 @@ $hm = 10])
- method setHtmlLinksStyle [line 15259]
+ method setHtmlLinksStyle [line 15285]
@@ -14834,7 +14834,7 @@ $fontstyle = 'U'])
- method setHtmlVSpace [line 15228]
+ method setHtmlVSpace [line 15254]
@@ -14873,7 +14873,7 @@ $tagvs)
- method setImageBuffer [line 15746]
+ method setImageBuffer [line 15772]
@@ -14960,7 +14960,7 @@ $scale)
- method setImageSubBuffer [line 15769]
+ method setImageSubBuffer [line 15795]
@@ -15357,7 +15357,7 @@ $page = -1])
- method setListIndentWidth [line 15238]
+ method setListIndentWidth [line 15264]
@@ -15396,7 +15396,7 @@ $width)
- method setLIsymbol [line 15148]
+ method setLIsymbol [line 15174]
@@ -15489,7 +15489,7 @@ $right = -1])
- method setOpenCell [line 15248]
+ method setOpenCell [line 15274]
@@ -15576,7 +15576,7 @@ $resetmargins = false])
- method setPageBuffer [line 15703]
+ method setPageBuffer [line 15729]
@@ -17205,7 +17205,7 @@ $page = ''])
- method startTransaction [line 16285]
+ method startTransaction [line 16311]
@@ -17295,7 +17295,7 @@ $page = ''])
- method swapMargins [line 15204]
+ method swapMargins [line 15230]
@@ -18561,7 +18561,7 @@ $code)
- method writeDiskCache [line 15631]
+ method writeDiskCache [line 15657]
@@ -21177,7 +21177,7 @@ $file)
|
|
diff --git a/doc/com-tecnick-tcpdf/TCPDFBarcode.html b/doc/com-tecnick-tcpdf/TCPDFBarcode.html
index 737d41a..8aa3882 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 cde5ddb..2986524 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 f859143..9eb62a9 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 b143b39..96d74a4 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 be3568f..7e05e44 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.034 |
+ version: | 4.8.035 |
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 |
@@ -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 02f9758..08c5d6b 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 4379a62..f1965f6 100644
--- a/doc/elementindex.html
+++ b/doc/elementindex.html
@@ -1456,7 +1456,7 @@
top
|
diff --git a/doc/elementindex_com-tecnick-tcpdf.html b/doc/elementindex_com-tecnick-tcpdf.html
index f2d8b01..5822df5 100644
--- a/doc/elementindex_com-tecnick-tcpdf.html
+++ b/doc/elementindex_com-tecnick-tcpdf.html
@@ -1479,7 +1479,7 @@
top
|
diff --git a/doc/errors.html b/doc/errors.html
index cfb9a3e..f58dff9 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 499c181..cef85be 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 499c181..cef85be 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/examples/example_010.php b/examples/example_010.php
index a741152..d4296d1 100755
--- a/examples/example_010.php
+++ b/examples/example_010.php
@@ -2,7 +2,7 @@
//============================================================+
// File name : example_010.php
// Begin : 2008-03-04
-// Last Update : 2009-09-30
+// Last Update : 2010-02-23
//
// Description : Example 010 for TCPDF class
// Text on multiple columns
@@ -68,10 +68,10 @@ class MYPDF extends TCPDF {
$this->SetRightMargin($this->w - $x - $this->colwidth);
}
$this->x = $x;
- //$this->x = $x + $this->cMargin; // use this for html mode
if ($col > 0) {
$this->y = $this->y0;
}
+ $this->newline = true;
}
//Method accepting or not automatic page break
@@ -105,12 +105,24 @@ class MYPDF extends TCPDF {
// store current margin values
$lMargin = $this->lMargin;
$rMargin = $this->rMargin;
+
// get esternal file content
$txt = file_get_contents($file, false);
- // Font
+
+ // set font
$this->SetFont('times', '', 9);
- // Output text in a column
- $this->MultiCell($this->colwidth, 5, $txt, 0, 'J', 0, 1, '', '', true, 0, false);
+
+ // set first column
+ $this->SetCol(0);
+
+ // ------ HTML MODE ------
+ //$this->writeHTML($txt, true, false, true, false, 'J');
+ // ------ HTML MODE ------
+
+ // ------ TEXT MODE ------
+ $this->Write(0, $txt, '', 0, 'J', true, 0, false, false, 0);
+ // ------ TEXT MODE ------
+
$this->Ln();
// Go back to first column
$this->SetCol(0);
diff --git a/tcpdf.php b/tcpdf.php
index 2c75acf..19691f4 100755
--- a/tcpdf.php
+++ b/tcpdf.php
@@ -2,9 +2,9 @@
//============================================================+
// File name : tcpdf.php
// Begin : 2002-08-03
-// Last Update : 2010-02-17
+// Last Update : 2010-02-23
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
-// Version : 4.8.034
+// Version : 4.8.035
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// ----------------------------------------------------------------------------
// Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l.
@@ -128,7 +128,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 4.8.034
+ * @version 4.8.035
*/
/**
@@ -152,14 +152,14 @@ if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
- define('PDF_PRODUCER', 'TCPDF 4.8.034 (http://www.tcpdf.org)');
+ define('PDF_PRODUCER', 'TCPDF 4.8.035 (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.034
+ * @version 4.8.035
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@@ -13353,57 +13353,77 @@ if (!class_exists('TCPDF', false)) {
if ((!$this->newline)
AND ($dom[$key]['value'] == 'img')
AND (isset($dom[$key]['attribute']['height']))
- AND ($dom[$key]['attribute']['height'] > 0)) {
-
+ AND ($dom[$key]['attribute']['height'] > 0)) {
// get image height
$imgh = $this->getHTMLUnitToUnits($dom[$key]['attribute']['height'], $this->lasth, 'px');
- if (!$this->InFooter) {
- // check for page break
- $this->checkPageBreak($imgh);
+ // check for automatic line break
+ $autolinebreak = false;
+ if (isset($dom[$key]['attribute']['width']) AND ($dom[$key]['attribute']['width'] > 0)) {
+ $imgw = $this->getHTMLUnitToUnits($dom[$key]['attribute']['width'], 1, 'px', false);
+ if (($this->rtl AND (($this->x - $imgw) < $this->lMargin))
+ OR (!$this->rtl AND (($this->x + $imgw) > ($this->w - $this->rMargin)))) {
+ // add automatic line break
+ $autolinebreak = true;
+ $this->Ln('', $cell);
+ // go back to evaluate this line break
+ --$key;
+ }
}
- if ($this->page > $startlinepage) {
- // fix line splitted over two pages
- if (isset($this->footerlen[$startlinepage])) {
- $curpos = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage];
- }
- // line to be moved one page forward
- $pagebuff = $this->getPageBuffer($startlinepage);
- $linebeg = substr($pagebuff, $startlinepos, ($curpos - $startlinepos));
- $tstart = substr($pagebuff, 0, $startlinepos);
- $tend = substr($this->getPageBuffer($startlinepage), $curpos);
- // remove line from previous page
- $this->setPageBuffer($startlinepage, $tstart.''.$tend);
- $pagebuff = $this->getPageBuffer($this->page);
- $tstart = substr($pagebuff, 0, $this->cntmrk[$this->page]);
- $tend = substr($pagebuff, $this->cntmrk[$this->page]);
- // add line start to current page
- $yshift = $minstartliney - $this->y;
- $try = sprintf('1 0 0 1 0 %.3F cm', ($yshift * $this->k));
- $this->setPageBuffer($this->page, $tstart."\nq\n".$try."\n".$linebeg."\nQ\n".$tend);
- // shift the annotations and links
- if (isset($this->PageAnnots[$this->page])) {
- $next_pask = count($this->PageAnnots[$this->page]);
- } else {
- $next_pask = 0;
- }
- if (isset($this->PageAnnots[$startlinepage])) {
- foreach ($this->PageAnnots[$startlinepage] as $pak => $pac) {
- if ($pak >= $pask) {
- $this->PageAnnots[$this->page][] = $pac;
- unset($this->PageAnnots[$startlinepage][$pak]);
- $npak = count($this->PageAnnots[$this->page]) - 1;
- $this->PageAnnots[$this->page][$npak]['y'] -= $yshift;
- }
+ if (!$autolinebreak) {
+ if (!$this->InFooter) {
+ $pre_y = $this->y;
+ // check for page break
+ $this->checkPageBreak($imgh);
+ $post_y = $this->y;
+ // check for multicolumn mode
+ if ($post_y < $pre_y) {
+ $startliney = $post_y;
}
-
}
- $pask = $next_pask;
- $startlinepos = $this->cntmrk[$this->page];
- $startlinepage = $this->page;
- $startliney = $this->y;
+ if ($this->page > $startlinepage) {
+ // fix line splitted over two pages
+ if (isset($this->footerlen[$startlinepage])) {
+ $curpos = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage];
+ }
+ // line to be moved one page forward
+ $pagebuff = $this->getPageBuffer($startlinepage);
+ $linebeg = substr($pagebuff, $startlinepos, ($curpos - $startlinepos));
+ $tstart = substr($pagebuff, 0, $startlinepos);
+ $tend = substr($this->getPageBuffer($startlinepage), $curpos);
+ // remove line from previous page
+ $this->setPageBuffer($startlinepage, $tstart.''.$tend);
+ $pagebuff = $this->getPageBuffer($this->page);
+ $tstart = substr($pagebuff, 0, $this->cntmrk[$this->page]);
+ $tend = substr($pagebuff, $this->cntmrk[$this->page]);
+ // add line start to current page
+ $yshift = $minstartliney - $this->y;
+ $try = sprintf('1 0 0 1 0 %.3F cm', ($yshift * $this->k));
+ $this->setPageBuffer($this->page, $tstart."\nq\n".$try."\n".$linebeg."\nQ\n".$tend);
+ // shift the annotations and links
+ if (isset($this->PageAnnots[$this->page])) {
+ $next_pask = count($this->PageAnnots[$this->page]);
+ } else {
+ $next_pask = 0;
+ }
+ if (isset($this->PageAnnots[$startlinepage])) {
+ foreach ($this->PageAnnots[$startlinepage] as $pak => $pac) {
+ if ($pak >= $pask) {
+ $this->PageAnnots[$this->page][] = $pac;
+ unset($this->PageAnnots[$startlinepage][$pak]);
+ $npak = count($this->PageAnnots[$this->page]) - 1;
+ $this->PageAnnots[$this->page][$npak]['y'] -= $yshift;
+ }
+ }
+
+ }
+ $pask = $next_pask;
+ $startlinepos = $this->cntmrk[$this->page];
+ $startlinepage = $this->page;
+ $startliney = $this->y;
+ }
+ $this->y += (($curfontsize / $this->k) - $imgh);
+ $minstartliney = min($this->y, $minstartliney);
}
- $this->y += (($curfontsize / $this->k) - $imgh);
- $minstartliney = min($this->y, $minstartliney);
} elseif (isset($dom[$key]['fontname']) OR isset($dom[$key]['fontstyle']) OR isset($dom[$key]['fontsize'])) {
// account for different font size
$pfontname = $curfontname;
@@ -13773,7 +13793,7 @@ if (!class_exists('TCPDF', false)) {
}
}
$this->newline = false;
- $pbrk = $this->checkPageBreak($this->lasth);
+ $pbrk = $this->checkPageBreak($this->lasth);
$this->SetFont($fontname, $fontstyle, $fontsize);
if ($wfill) {
$this->SetFillColorArray($this->bgcolor);
@@ -14051,11 +14071,16 @@ if (!class_exists('TCPDF', false)) {
}
if ($newline) {
if (!$this->premode) {
+ $prelen = strlen($dom[$key]['value']);
if ($this->isRTLTextDir()) {
$dom[$key]['value'] = rtrim($dom[$key]['value']);
} else {
$dom[$key]['value'] = ltrim($dom[$key]['value']);
}
+ $postlen = strlen($dom[$key]['value']);
+ if (($postlen == 0) AND ($prelen > 0)) {
+ $dom[$key]['trimmed_space'] = true;
+ }
}
$newline = false;
$firstblock = true;
@@ -14349,11 +14374,12 @@ if (!class_exists('TCPDF', false)) {
$type = $this->getImageFileType($tag['attribute']['src']);
$prevy = $this->y;
$xpos = $this->GetX();
- if (isset($dom[($key - 1)]) AND ($dom[($key - 1)]['value'] == ' ')) {
- if ($this->rtl) {
- $xpos += $this->GetStringWidth(chr(32));
- } else {
+ // eliminate marker spaces
+ if (isset($dom[($key - 1)])) {
+ if (($dom[($key - 1)]['value'] == ' ') OR (isset($dom[($key - 1)]['trimmed_space']))) {
$xpos -= $this->GetStringWidth(chr(32));
+ } elseif ($this->rtl AND $dom[($key - 1)]['value'] == ' ') {
+ $xpos -= (2 * $this->GetStringWidth(chr(32)));
}
}
$imglink = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|