@@ -6561,7 +6561,7 @@ $k)
- method addTOC [line 16169]
+ method addTOC [line 16168]
@@ -7519,7 +7519,7 @@ $h)
- method closeHTMLTagHandler [line 14792]
+ method closeHTMLTagHandler [line 14791]
@@ -7663,7 +7663,7 @@ $js = false])
- method commitTransaction [line 16327]
+ method commitTransaction [line 16326]
@@ -7934,7 +7934,7 @@ $fill_color = array()])
- method deletePage [line 16027]
+ method deletePage [line 16026]
@@ -8093,7 +8093,7 @@ $afinish:)
- method empty_string [line 16381]
+ method empty_string [line 16380]
@@ -8642,7 +8642,7 @@ $pagenum = ''])
- method getBuffer [line 15713]
+ method getBuffer [line 15712]
@@ -8842,7 +8842,7 @@ $char)
- method getFontBuffer [line 15873]
+ method getFontBuffer [line 15872]
@@ -9165,7 +9165,7 @@ $v)
- method getGraphicVars [line 15581]
+ method getGraphicVars [line 15580]
@@ -9381,7 +9381,7 @@ $html)
- method getHTMLUnitToUnits [line 15300]
+ method getHTMLUnitToUnits [line 15299]
@@ -9447,7 +9447,7 @@ $point)
- method getImageBuffer [line 15815]
+ method getImageBuffer [line 15814]
@@ -9835,7 +9835,7 @@ $w = 0])
- method getObjFilename [line 15645]
+ method getObjFilename [line 15644]
@@ -9945,7 +9945,7 @@ $prefix)
- method getPageBuffer [line 15756]
+ method getPageBuffer [line 15755]
@@ -10958,7 +10958,7 @@ $script)
- method intToRoman [line 15374]
+ method intToRoman [line 15373]
@@ -11610,7 +11610,7 @@ $y = ''])
- method movePage [line 15890]
+ method movePage [line 15889]
@@ -11784,7 +11784,7 @@ $maxh = 0])
- method objclone [line 16370]
+ method objclone [line 16369]
@@ -11857,7 +11857,7 @@ $object)
- method openHTMLTagHandler [line 14246]
+ method openHTMLTagHandler [line 14245]
@@ -12366,7 +12366,7 @@ $closed)
- method putHtmlListBullet [line 15439]
+ method putHtmlListBullet [line 15438]
@@ -12585,7 +12585,7 @@ $js = false])
- method readDiskCache [line 15685]
+ method readDiskCache [line 15684]
@@ -12915,7 +12915,7 @@ $length)
- method rollbackTransaction [line 16341]
+ method rollbackTransaction [line 16340]
@@ -13491,7 +13491,7 @@ $bc = ''])
- method SetBooklet [line 15214]
+ method SetBooklet [line 15213]
@@ -13542,7 +13542,7 @@ $outer = -1])
- method setBuffer [line 15695]
+ method setBuffer [line 15694]
@@ -14310,7 +14310,7 @@ $fontfile = ''])
- method setFontBuffer [line 15831]
+ method setFontBuffer [line 15830]
@@ -14397,7 +14397,7 @@ $size)
- method setFontSubBuffer [line 15853]
+ method setFontSubBuffer [line 15852]
@@ -14593,7 +14593,7 @@ $prop = array()])
- method setGraphicVars [line 15612]
+ method setGraphicVars [line 15611]
@@ -14789,7 +14789,7 @@ $hm = 10])
- method setHtmlLinksStyle [line 15285]
+ method setHtmlLinksStyle [line 15284]
@@ -14834,7 +14834,7 @@ $fontstyle = 'U'])
- method setHtmlVSpace [line 15254]
+ method setHtmlVSpace [line 15253]
@@ -14873,7 +14873,7 @@ $tagvs)
- method setImageBuffer [line 15772]
+ method setImageBuffer [line 15771]
@@ -14960,7 +14960,7 @@ $scale)
- method setImageSubBuffer [line 15795]
+ method setImageSubBuffer [line 15794]
@@ -15357,7 +15357,7 @@ $page = -1])
- method setListIndentWidth [line 15264]
+ method setListIndentWidth [line 15263]
@@ -15396,7 +15396,7 @@ $width)
- method setLIsymbol [line 15174]
+ method setLIsymbol [line 15173]
@@ -15489,7 +15489,7 @@ $right = -1])
- method setOpenCell [line 15274]
+ method setOpenCell [line 15273]
@@ -15576,7 +15576,7 @@ $resetmargins = false])
- method setPageBuffer [line 15729]
+ method setPageBuffer [line 15728]
@@ -17205,7 +17205,7 @@ $page = ''])
- method startTransaction [line 16311]
+ method startTransaction [line 16310]
@@ -17295,7 +17295,7 @@ $page = ''])
- method swapMargins [line 15230]
+ method swapMargins [line 15229]
@@ -18561,7 +18561,7 @@ $code)
- method writeDiskCache [line 15657]
+ method writeDiskCache [line 15656]
@@ -21177,7 +21177,7 @@ $file)
|
|
diff --git a/doc/com-tecnick-tcpdf/TCPDFBarcode.html b/doc/com-tecnick-tcpdf/TCPDFBarcode.html
index 8aa3882..4d44272 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 2986524..1a48dcb 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 9eb62a9..5d0fb14 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 96d74a4..85806e9 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 7e05e44..62d7ddf 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.035 |
+ version: | 4.8.036 |
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 08c5d6b..9c8d250 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 f1965f6..886e99b 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 5822df5..7f8e088 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 f58dff9..80bd0d0 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 cef85be..bdd906c 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 cef85be..bdd906c 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_008.php b/examples/example_008.php
index 20f2f07..a7d1af1 100755
--- a/examples/example_008.php
+++ b/examples/example_008.php
@@ -2,7 +2,7 @@
//============================================================+
// File name : example_008.php
// Begin : 2008-03-04
-// Last Update : 2009-09-30
+// Last Update : 2010-02-24
//
// Description : Example 008 for TCPDF class
// Include external UTF-8 text file
@@ -82,7 +82,7 @@ $utf8text = file_get_contents('../cache/utf8test.txt', false);
$pdf->SetFillColor(230, 240, 255, true);
// write the text
-$pdf->Write(5,$utf8text, '', 1);
+$pdf->Write(5, $utf8text, '', 1);
// ---------------------------------------------------------
diff --git a/examples/example_010.php b/examples/example_010.php
index d4296d1..e2c1267 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 : 2010-02-23
+// Last Update : 2010-02-24
//
// Description : Example 010 for TCPDF class
// Text on multiple columns
@@ -33,31 +33,50 @@
require_once('../config/lang/eng.php');
require_once('../tcpdf.php');
-// extend TCPF with custom functions
-class MYPDF extends TCPDF {
+
+/**
+* Extend TCPDF to work with multiple columns
+*/
+class MC_TCPDF extends TCPDF {
- //number of colums
+ /**
+ * @var number of colums
+ * @access protected
+ */
protected $ncols = 3;
- // columns width
+ /**
+ * @var columns width
+ * @access protected
+ */
protected $colwidth = 57;
- //Current column
+ /**
+ * @var current column
+ * @access protected
+ */
protected $col = 0;
- //Ordinate of column start
- protected $y0;
-
- //Set position at a given column
+ /**
+ * @var y position of the beginning of column
+ * @access protected
+ */
+ protected $col_start_y;
+
+ /**
+ * Set position at a given column
+ * @param $col column number (from 0 to $ncols-1)
+ * @access public
+ */
public function SetCol($col) {
$this->col = $col;
- // space between columns
+ // set space between columns
if ($this->ncols > 1) {
$column_space = round((float)($this->w - $this->original_lMargin - $this->original_rMargin - ($this->ncols * $this->colwidth)) / ($this->ncols - 1));
} else {
$column_space = 0;
}
- // X position of the current column
+ // set X position of the current column by case
if ($this->rtl) {
$x = $this->w - $this->original_rMargin - ($col * ($this->colwidth + $column_space));
$this->SetRightMargin($this->w - $x);
@@ -69,60 +88,69 @@ class MYPDF extends TCPDF {
}
$this->x = $x;
if ($col > 0) {
- $this->y = $this->y0;
+ // set Y position for the column
+ $this->y = $this->col_start_y;
}
+ // fix for HTML mode
$this->newline = true;
}
- //Method accepting or not automatic page break
+ /**
+ * Overwrites the AcceptPageBreak() method to switch between columns
+ * @return boolean false
+ * @access public
+ */
public function AcceptPageBreak() {
if($this->col < ($this->ncols - 1)) {
- //Go to next column
+ // go to next column
$this->SetCol($this->col + 1);
- //Keep on page
- return false;
} else {
+ // go back to first column on the new page
$this->AddPage();
- //Go back to first column
$this->SetCol(0);
- //Page break
- return false;
}
+ // avoid page breaking from checkPageBreak()
+ return false;
}
- // Set chapter title
- public function ChapterTitle($num, $label) {
+ /**
+ * Set chapter title
+ * @param int $num chapter number
+ * @param string $title chapter title
+ * @access public
+ */
+ public function ChapterTitle($num, $title) {
$this->SetFont('helvetica', '', 14);
$this->SetFillColor(200, 220, 255);
- $this->Cell(0, 6, 'Chapter '.$num.' : '.$label, 0, 1, '', 1);
+ $this->Cell(0, 6, 'Chapter '.$num.' : '.$title, 0, 1, '', 1);
$this->Ln(4);
- // Save ordinate
- $this->y0 = $this->GetY();
+ // save current Y position
+ $this->col_start_y = $this->GetY();
}
- // Print chapter body
- public function ChapterBody($file) {
+ /**
+ * Print chapter body
+ * @param string $file name of the file containing the chapter body
+ * @param boolean $mode if true the chapter body is in HTML, otherwise in simple text.
+ * @access public
+ */
+ public function ChapterBody($file, $mode=false) {
// store current margin values
$lMargin = $this->lMargin;
$rMargin = $this->rMargin;
-
// get esternal file content
$txt = file_get_contents($file, false);
-
// set font
$this->SetFont('times', '', 9);
-
// 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 ------
-
+ if ($mode) {
+ // ------ HTML MODE ------
+ $this->writeHTML($txt, true, false, true, false, 'J');
+ } else {
+ // ------ TEXT MODE ------
+ $this->Write(0, $txt, '', 0, 'J', true, 0, false, false, 0);
+ }
$this->Ln();
// Go back to first column
$this->SetCol(0);
@@ -131,16 +159,26 @@ class MYPDF extends TCPDF {
$this->SetRightMargin($rMargin);
}
- //Add chapter
- public function PrintChapter($num,$title,$file) {
+ /**
+ * Print chapter
+ * @param int $num chapter number
+ * @param string $title chapter title
+ * @param string $file name of the file containing the chapter body
+ * @param boolean $mode if true the chapter body is in HTML, otherwise in simple text.
+ * @access public
+ */
+ public function PrintChapter($num, $title, $file, $mode=false) {
$this->AddPage();
- $this->ChapterTitle($num,$title);
- $this->ChapterBody($file);
+ $this->ChapterTitle($num, $title);
+ $this->ChapterBody($file, $mode);
}
}
+// ---------------------------------------------------------
+// EXAMPLE
+// ---------------------------------------------------------
// create new PDF document
-$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
+$pdf = new MC_TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
@@ -175,8 +213,11 @@ $pdf->setLanguageArray($l);
// ---------------------------------------------------------
-$pdf->PrintChapter(1, 'A RUNAWAY REEF', '../cache/chapter_demo_1.txt');
-$pdf->PrintChapter(2, 'THE PROS AND CONS', '../cache/chapter_demo_2.txt');
+// print a text
+$pdf->PrintChapter(1, 'A RUNAWAY REEF', '../cache/chapter_demo_1.txt', false);
+
+// print an html text
+$pdf->PrintChapter(2, 'THE PROS AND CONS', '../cache/chapter_demo_2.txt', true);
// ---------------------------------------------------------
diff --git a/tcpdf.php b/tcpdf.php
index 19691f4..f393a35 100755
--- a/tcpdf.php
+++ b/tcpdf.php
@@ -2,9 +2,9 @@
//============================================================+
// File name : tcpdf.php
// Begin : 2002-08-03
-// Last Update : 2010-02-23
+// Last Update : 2010-02-24
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
-// Version : 4.8.035
+// Version : 4.8.036
// 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.035
+ * @version 4.8.036
*/
/**
@@ -152,14 +152,14 @@ if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
- define('PDF_PRODUCER', 'TCPDF 4.8.035 (http://www.tcpdf.org)');
+ define('PDF_PRODUCER', 'TCPDF 4.8.036 (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.035
+ * @version 4.8.036
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
@@ -13374,10 +13374,9 @@ if (!class_exists('TCPDF', false)) {
$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;
+ if ($this->y < $pre_y) {
+ // fix for multicolumn mode
+ $startliney = $this->y;
}
}
if ($this->page > $startlinepage) {
@@ -13396,7 +13395,7 @@ if (!class_exists('TCPDF', false)) {
$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;
+ $yshift = $minstartliney - $this->y + ($curfontsize / $this->k);
$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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|