mirror of
https://github.com/vdm-io/tcpdf.git
synced 2024-11-22 21:05:10 +00:00
5.9.056
This commit is contained in:
parent
ffdd909d64
commit
279df4ca9f
@ -1,3 +1,7 @@
|
|||||||
|
5.9.056 (2011-02-22)
|
||||||
|
- A bug on fixHTMLCode() method was fixed.
|
||||||
|
- Automatic line break for HTML was fixed.
|
||||||
|
|
||||||
5.9.055 (2011-02-17)
|
5.9.055 (2011-02-17)
|
||||||
- Another bug related to HTML table page break was fixed.
|
- Another bug related to HTML table page break was fixed.
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
|
|||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
||||||
Name: TCPDF
|
Name: TCPDF
|
||||||
Version: 5.9.055
|
Version: 5.9.056
|
||||||
Release date: 2011-02-17
|
Release date: 2011-02-22
|
||||||
Author: Nicola Asuni
|
Author: Nicola Asuni
|
||||||
|
|
||||||
Copyright (c) 2002-2011:
|
Copyright (c) 2002-2011:
|
||||||
|
149
tcpdf.php
149
tcpdf.php
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
//============================================================+
|
//============================================================+
|
||||||
// File name : tcpdf.php
|
// File name : tcpdf.php
|
||||||
// Version : 5.9.055
|
// Version : 5.9.056
|
||||||
// Begin : 2002-08-03
|
// Begin : 2002-08-03
|
||||||
// Last Update : 2011-02-17
|
// Last Update : 2011-02-22
|
||||||
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
|
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
|
||||||
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS.
|
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS.
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
@ -134,7 +134,7 @@
|
|||||||
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
|
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
|
||||||
* @package com.tecnick.tcpdf
|
* @package com.tecnick.tcpdf
|
||||||
* @author Nicola Asuni
|
* @author Nicola Asuni
|
||||||
* @version 5.9.055
|
* @version 5.9.056
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
|
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
|
||||||
@ -146,7 +146,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.<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>
|
||||||
* @package com.tecnick.tcpdf
|
* @package com.tecnick.tcpdf
|
||||||
* @brief PHP class for generating PDF documents without requiring external extensions.
|
* @brief PHP class for generating PDF documents without requiring external extensions.
|
||||||
* @version 5.9.055
|
* @version 5.9.056
|
||||||
* @author Nicola Asuni - info@tecnick.com
|
* @author Nicola Asuni - info@tecnick.com
|
||||||
*/
|
*/
|
||||||
class TCPDF {
|
class TCPDF {
|
||||||
@ -157,7 +157,7 @@ class TCPDF {
|
|||||||
* Current TCPDF version.
|
* Current TCPDF version.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
private $tcpdf_version = '5.9.055';
|
private $tcpdf_version = '5.9.056';
|
||||||
|
|
||||||
// Protected properties
|
// Protected properties
|
||||||
|
|
||||||
@ -6589,6 +6589,8 @@ class TCPDF {
|
|||||||
$shy_replacement_width = $this->GetCharWidth($shy_replacement);
|
$shy_replacement_width = $this->GetCharWidth($shy_replacement);
|
||||||
// max Y
|
// max Y
|
||||||
$maxy = $this->y + $maxh - $h - $this->cell_padding['T'] - $this->cell_padding['B'];
|
$maxy = $this->y + $maxh - $h - $this->cell_padding['T'] - $this->cell_padding['B'];
|
||||||
|
// page width
|
||||||
|
$pw = $w = $this->w - $this->lMargin - $this->rMargin;
|
||||||
// calculate remaining line width ($w)
|
// calculate remaining line width ($w)
|
||||||
if ($this->rtl) {
|
if ($this->rtl) {
|
||||||
$w = $this->x - $this->lMargin;
|
$w = $this->x - $this->lMargin;
|
||||||
@ -6767,56 +6769,95 @@ class TCPDF {
|
|||||||
} else {
|
} else {
|
||||||
$endspace = 0;
|
$endspace = 0;
|
||||||
}
|
}
|
||||||
if ($shy) {
|
// check the lenght of the next string
|
||||||
// add hypen (minus symbol) at the end of the line
|
$strrest = $this->UniArrSubString($uchars, ($sep + $endspace));
|
||||||
$shy_width = $tmp_shy_replacement_width;
|
$nextstr = preg_split('/'.$this->re_space['p'].'/'.$this->re_space['m'], $this->stringTrim($strrest));
|
||||||
if ($this->rtl) {
|
if (isset($nextstr[0]) AND ($this->GetStringWidth($nextstr[0]) > $pw)) {
|
||||||
$shy_char_left = $tmp_shy_replacement_char;
|
// truncate the word because do not fit on a full page width
|
||||||
$shy_char_right = '';
|
$tmpstr = $this->UniArrSubString($uchars, $j, $i);
|
||||||
} else {
|
if ($firstline) {
|
||||||
$shy_char_left = '';
|
$startx = $this->x;
|
||||||
$shy_char_right = $tmp_shy_replacement_char;
|
$tmparr = array_slice($chars, $j, ($i - $j));
|
||||||
|
if ($rtlmode) {
|
||||||
|
$tmparr = $this->utf8Bidi($tmparr, $tmpstr, $this->tmprtl);
|
||||||
|
}
|
||||||
|
$linew = $this->GetArrStringWidth($tmparr);
|
||||||
|
unset($tmparr);
|
||||||
|
if ($this->rtl) {
|
||||||
|
$this->endlinex = $startx - $linew;
|
||||||
|
} else {
|
||||||
|
$this->endlinex = $startx + $linew;
|
||||||
|
}
|
||||||
|
$w = $linew;
|
||||||
|
$tmpcellpadding = $this->cell_padding;
|
||||||
|
if ($maxh == 0) {
|
||||||
|
$this->SetCellPadding(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if ($firstblock AND $this->isRTLTextDir()) {
|
||||||
|
$tmpstr = $this->stringRightTrim($tmpstr);
|
||||||
|
}
|
||||||
|
$this->Cell($w, $h, $tmpstr, 0, 1, $align, $fill, $link, $stretch);
|
||||||
|
unset($tmpstr);
|
||||||
|
if ($firstline) {
|
||||||
|
$this->cell_padding = $tmpcellpadding;
|
||||||
|
return ($this->UniArrSubString($uchars, $i));
|
||||||
|
}
|
||||||
|
$j = $i;
|
||||||
|
--$i;
|
||||||
} else {
|
} else {
|
||||||
$shy_width = 0;
|
// word wrapping
|
||||||
$shy_char_left = '';
|
if ($shy) {
|
||||||
$shy_char_right = '';
|
// add hypen (minus symbol) at the end of the line
|
||||||
}
|
$shy_width = $tmp_shy_replacement_width;
|
||||||
$tmpstr = $this->UniArrSubString($uchars, $j, ($sep + $endspace));
|
if ($this->rtl) {
|
||||||
if ($firstline) {
|
$shy_char_left = $tmp_shy_replacement_char;
|
||||||
$startx = $this->x;
|
$shy_char_right = '';
|
||||||
$tmparr = array_slice($chars, $j, (($sep + $endspace) - $j));
|
} else {
|
||||||
if ($rtlmode) {
|
$shy_char_left = '';
|
||||||
$tmparr = $this->utf8Bidi($tmparr, $tmpstr, $this->tmprtl);
|
$shy_char_right = $tmp_shy_replacement_char;
|
||||||
}
|
}
|
||||||
$linew = $this->GetArrStringWidth($tmparr);
|
|
||||||
unset($tmparr);
|
|
||||||
if ($this->rtl) {
|
|
||||||
$this->endlinex = $startx - $linew - $shy_width;
|
|
||||||
} else {
|
} else {
|
||||||
$this->endlinex = $startx + $linew + $shy_width;
|
$shy_width = 0;
|
||||||
|
$shy_char_left = '';
|
||||||
|
$shy_char_right = '';
|
||||||
}
|
}
|
||||||
$w = $linew;
|
$tmpstr = $this->UniArrSubString($uchars, $j, ($sep + $endspace));
|
||||||
$tmpcellpadding = $this->cell_padding;
|
if ($firstline) {
|
||||||
if ($maxh == 0) {
|
$startx = $this->x;
|
||||||
$this->SetCellPadding(0);
|
$tmparr = array_slice($chars, $j, (($sep + $endspace) - $j));
|
||||||
|
if ($rtlmode) {
|
||||||
|
$tmparr = $this->utf8Bidi($tmparr, $tmpstr, $this->tmprtl);
|
||||||
|
}
|
||||||
|
$linew = $this->GetArrStringWidth($tmparr);
|
||||||
|
unset($tmparr);
|
||||||
|
if ($this->rtl) {
|
||||||
|
$this->endlinex = $startx - $linew - $shy_width;
|
||||||
|
} else {
|
||||||
|
$this->endlinex = $startx + $linew + $shy_width;
|
||||||
|
}
|
||||||
|
$w = $linew;
|
||||||
|
$tmpcellpadding = $this->cell_padding;
|
||||||
|
if ($maxh == 0) {
|
||||||
|
$this->SetCellPadding(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// print the line
|
||||||
|
if ($firstblock AND $this->isRTLTextDir()) {
|
||||||
|
$tmpstr = $this->stringRightTrim($tmpstr);
|
||||||
|
}
|
||||||
|
$this->Cell($w, $h, $shy_char_left.$tmpstr.$shy_char_right, 0, 1, $align, $fill, $link, $stretch);
|
||||||
|
unset($tmpstr);
|
||||||
|
if ($firstline) {
|
||||||
|
// return the remaining text
|
||||||
|
$this->cell_padding = $tmpcellpadding;
|
||||||
|
return ($this->UniArrSubString($uchars, ($sep + $endspace)));
|
||||||
|
}
|
||||||
|
$i = $sep;
|
||||||
|
$sep = -1;
|
||||||
|
$shy = false;
|
||||||
|
$j = ($i+1);
|
||||||
}
|
}
|
||||||
// print the line
|
|
||||||
if ($firstblock AND $this->isRTLTextDir()) {
|
|
||||||
$tmpstr = $this->stringRightTrim($tmpstr);
|
|
||||||
}
|
|
||||||
$this->Cell($w, $h, $shy_char_left.$tmpstr.$shy_char_right, 0, 1, $align, $fill, $link, $stretch);
|
|
||||||
unset($tmpstr);
|
|
||||||
if ($firstline) {
|
|
||||||
// return the remaining text
|
|
||||||
$this->cell_padding = $tmpcellpadding;
|
|
||||||
return ($this->UniArrSubString($uchars, ($sep + $endspace)));
|
|
||||||
}
|
|
||||||
$i = $sep;
|
|
||||||
$sep = -1;
|
|
||||||
$shy = false;
|
|
||||||
$j = ($i+1);
|
|
||||||
}
|
}
|
||||||
// account for margin changes
|
// account for margin changes
|
||||||
if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND (!$this->InFooter)) {
|
if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND (!$this->InFooter)) {
|
||||||
@ -17619,7 +17660,11 @@ class TCPDF {
|
|||||||
$css = str_replace('/*<![CDATA[*/', '', $css);
|
$css = str_replace('/*<![CDATA[*/', '', $css);
|
||||||
$css = str_replace('/*]]>*/', '', $css);
|
$css = str_replace('/*]]>*/', '', $css);
|
||||||
preg_match('/<style>(.*)<\/style>/ims', $css, $matches);
|
preg_match('/<style>(.*)<\/style>/ims', $css, $matches);
|
||||||
$css = strtolower($matches[1]);
|
if (isset($matches[1])) {
|
||||||
|
$css = strtolower($matches[1]);
|
||||||
|
} else {
|
||||||
|
$css = '';
|
||||||
|
}
|
||||||
// include default css
|
// include default css
|
||||||
$css = '<style>'.$default_css.$css.'</style>';
|
$css = '<style>'.$default_css.$css.'</style>';
|
||||||
// get the body part
|
// get the body part
|
||||||
@ -19038,7 +19083,7 @@ class TCPDF {
|
|||||||
// text
|
// text
|
||||||
$dom[$key]['tag'] = false;
|
$dom[$key]['tag'] = false;
|
||||||
$dom[$key]['block'] = false;
|
$dom[$key]['block'] = false;
|
||||||
$element = str_replace('$nbsp;', $this->unichr(160), $element);
|
$element = str_replace(' ', $this->unichr(160), $element);
|
||||||
$dom[$key]['value'] = stripslashes($this->unhtmlentities($element));
|
$dom[$key]['value'] = stripslashes($this->unhtmlentities($element));
|
||||||
$dom[$key]['parent'] = end($level);
|
$dom[$key]['parent'] = end($level);
|
||||||
$dom[$key]['dir'] = $dom[$dom[$key]['parent']]['dir'];
|
$dom[$key]['dir'] = $dom[$dom[$key]['parent']]['dir'];
|
||||||
@ -20353,9 +20398,11 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (($wadj > 0) AND (($strlinelen + $wadj) >= $cwa)) {
|
if (($wadj > 0) AND (($strlinelen + $wadj) >= $cwa)) {
|
||||||
|
$wadj = 0;
|
||||||
$nextstr = preg_split('/'.$this->re_space['p'].'/'.$this->re_space['m'], $dom[$key]['value']);
|
$nextstr = preg_split('/'.$this->re_space['p'].'/'.$this->re_space['m'], $dom[$key]['value']);
|
||||||
$numblks = count($nextstr);
|
$numblks = count($nextstr);
|
||||||
if ($numblks > 1) {
|
if ($numblks > 1) {
|
||||||
|
// try to split on blank spaces
|
||||||
$wadj = ($cwa - $strlinelen + $this->GetStringWidth($nextstr[($numblks - 1)]));
|
$wadj = ($cwa - $strlinelen + $this->GetStringWidth($nextstr[($numblks - 1)]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user