X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Ftcpdf.php;h=0d3d210844778657df5a846ceb3617f2b86d11b6;hb=54eb0e92cb17c72b8edf5ec88e6fe795e1ef91f0;hp=46ac9184477abd6f405f1224491c81b9deeef32a;hpb=b855efb8cb1880e44620b1a70b63bfe89110e880;p=fa-stable.git diff --git a/reporting/includes/tcpdf.php b/reporting/includes/tcpdf.php index 46ac9184..0d3d2108 100644 --- a/reporting/includes/tcpdf.php +++ b/reporting/includes/tcpdf.php @@ -2,9 +2,9 @@ //============================================================+ // File name : tcpdf.php // Begin : 2002-08-03 -// Last Update : 2008-09-17 +// Last Update : 2008-09-19 // Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org -// Version : 4.0.026_PHP4 +// Version : 4.0.027_PHP4 // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) // ---------------------------------------------------------------------------- // Copyright (C) 2002-2008 Nicola Asuni - Tecnick.com S.r.l. @@ -120,7 +120,7 @@ * @copyright 2004-2008 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.0.026_PHP4 + * @version 4.0.027_PHP4 */ /** @@ -141,12 +141,15 @@ * and * if (!defined("K_RE_PATTERN_ARABIC")) * 4. Parameter $unicode in constructor renamed to $uni. - * 4. Header function renamed to Header1 (due to conflict with FrontReport Header) + * 5. Header function renamed to Header1 (due to conflict with FrontReport Header) + * 6. Line 6190, SetLineWidth (cast of values to avoid problem in PHP 5.2.6 + * 7. Line 6261. ereg replaced by preg_match (with start and end delimiter) + * 8. Lines 8642,9256 and 9348. split replaced by preg_split. * ------------------------------------------------------------------------------- */ if (!defined("K_PATH_FONTS")) - define ("K_PATH_FONTS", '../reporting/fonts/'); -define ("K_PATH_CACHE", '../reporting/fonts/'); + define ("K_PATH_FONTS", dirname(__FILE__)."/../fonts/"); +define ("K_PATH_CACHE", dirname(__FILE__)."/../fonts/"); define("K_CELL_HEIGHT_RATIO", 1.25); //require_once(dirname(__FILE__).'/config/tcpdf_config.php'); @@ -174,18 +177,29 @@ require_once(dirname(__FILE__)."/barcodes.php"); */ require_once(dirname(__FILE__)."/html_entity_decode_php4.php"); +// +// Check image file format against specific TCPDF engine requirements. +// +function check_image_file($filename) +{ + $test = new TCPDF(); + if ( !$test->Image($filename, 0, 0) ) + return _('Unsupported image file format.'); + return ''; +} + if (!class_exists('TCPDF')) { /** * define default PDF document producer */ - define('PDF_PRODUCER','TCPDF 4.0.026_PHP4 (http://www.tcpdf.org)'); + define('PDF_PRODUCER','TCPDF 4.0.027_PHP4 (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.0.026_PHP4 + * @version 4.0.027_PHP4 * @author Nicola Asuni - info@tecnick.com * @link http://www.tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL @@ -610,7 +624,7 @@ if (!class_exists('TCPDF')) { * @var Header font. * @access protected */ - var $header_font; + var $header_font = array('helvetica', '', 12); /** * @var Footer font. @@ -1109,7 +1123,7 @@ if (!class_exists('TCPDF')) { * @param boolean $unicode TRUE means that the input text is unicode (default = true) * @param String $encoding charset encoding; default is UTF-8 */ - function TCPDF($orientation='P', $unit='mm', $format='A4', $uni=true, $encoding="UTF-8") { + function __construct($orientation='P', $unit='mm', $format='A4', $uni=true, $encoding="UTF-8") { if ($uni) // Fix for FrontAccounting { global $unicode, $unicode_mirror, $unicode_arlet, $laa_array, $diacritics; @@ -1121,7 +1135,8 @@ if (!class_exists('TCPDF')) { mb_internal_encoding("ASCII"); } // set language direction - $this->rtl = $this->l['a_meta_dir']=='rtl' ? true : false; + + $this->rtl = @$this->l['a_meta_dir']=='rtl' ? true : false; $this->tmprtl = false; //Some checks $this->_dochecks(); @@ -1756,7 +1771,8 @@ if (!class_exists('TCPDF')) { */ function Error($msg) { //Fatal error - die('TCPDF error: '.$msg); + display_error('TCPDF error: '.$msg); + exit; } /** @@ -2602,9 +2618,9 @@ if (!class_exists('TCPDF')) { if (isset($cw)) { unset($cw); } - include($this->_getfontpath().$file); + @include($this->_getfontpath().$file); if ((!isset($type)) OR (!isset($cw))) { - $this->Error('Could not include font definition file'); + $this->Error("Could not include font definition file: ".$file); } $i = count($this->fonts) + 1; // register CID font (all styles at once) @@ -3516,6 +3532,8 @@ if (!class_exists('TCPDF')) { function unichr($c) { if (!$this->isunicode) { return chr($c); + } elseif ($c == '') { + return ''; } elseif ($c <= 0x7F) { // one byte return chr($c); @@ -3593,8 +3611,8 @@ if (!class_exists('TCPDF')) { if ($type == "jpg") { $type = "jpeg"; } - $mqr = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); + $mqr = ini_get('magic_quotes_runtime'); + ini_set('magic_quotes_runtime', 0); // Specific image handlers $mtd = '_parse'.$type; // GD image handler function @@ -3621,7 +3639,7 @@ if (!class_exists('TCPDF')) { //If false, we cannot process image return; } - set_magic_quotes_runtime($mqr); + ini_set('magic_quotes_runtime', $mqr); $info['i'] = count($this->images) + 1; // add image to document $this->images[$file] = $info; @@ -3700,6 +3718,7 @@ if (!class_exists('TCPDF')) { } } $this->endlinex = $this->img_rb_x; + return $info; } /** @@ -4501,8 +4520,8 @@ if (!class_exists('TCPDF')) { $this->_out('<>'); $this->_out('endobj'); } - $mqr = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); + $mqr = ini_get('magic_quotes_runtime'); + ini_set('magic_quotes_runtime', 0); foreach($this->FontFiles as $file => $info) { //Font file embedding $this->_newobj(); @@ -4510,12 +4529,12 @@ if (!class_exists('TCPDF')) { $font = file_get_contents($this->_getfontpath().strtolower($file)); $compressed = (substr($file,-2)=='.z'); if ((!$compressed) AND (isset($info['length2']))) { - $header = (ord($font{0}) == 128); + $header = (ord($font[0]) == 128); if ($header) { //Strip first binary header $font = substr($font,6); } - if ($header AND (ord($font{$info['length1']}) == 128)) { + if ($header AND (ord($font[$info['length1']]) == 128)) { //Strip second binary header $font = substr($font, 0, $info['length1']).substr($font, $info['length1']+6); } @@ -4532,7 +4551,7 @@ if (!class_exists('TCPDF')) { $this->_putstream($font); $this->_out('endobj'); } - set_magic_quotes_runtime($mqr); + ini_set('magic_quotes_runtime', $mqr); foreach($this->fonts as $k => $font) { //Font objects $this->fonts[$k]['n'] = $this->n + 1; @@ -4686,7 +4705,7 @@ if (!class_exists('TCPDF')) { function _putimages() { $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; reset($this->images); - while (list($file, $info) = each($this->images)) { + foreach ($this->images as $file => $info) { $this->_newobj(); $this->images[$file]['n'] = $this->n; $this->_out('<_out('%PDF-'.$this->PDFVersion); + $this->buffer = '%PDF-'.$this->PDFVersion."\n".$this->buffer; +// $this->_out('%PDF-'.$this->PDFVersion); } /** @@ -5390,7 +5410,7 @@ if (!class_exists('TCPDF')) { $strarr = array(); $strlen = strlen($str); for($i=0; $i < $strlen; $i++) { - $strarr[] = ord($str{$i}); + $strarr[] = ord($str[$i]); } return $strarr; } @@ -5400,7 +5420,7 @@ if (!class_exists('TCPDF')) { $str .= ""; // force $str to be a string $length = strlen($str); for($i = 0; $i < $length; $i++) { - $char = ord($str{$i}); // get one string character at time + $char = ord($str[$i]); // get one string character at time if (count($bytes) == 0) { // get starting octect if ($char <= 0x7F) { $unicode[] = $char; // use the character "as is" because is ASCII @@ -5726,10 +5746,7 @@ if (!class_exists('TCPDF')) { * @return string converted */ function unhtmlentities($text_to_convert) { - if (!$this->isunicode) { - return html_entity_decode($text_to_convert); - } - return html_entity_decode_php4($text_to_convert); + return html_entity_decode($text_to_convert, ENT_QUOTES, $this->encoding); } // ENCRYPTION METHODS ---------------------------------- @@ -5772,7 +5789,7 @@ if (!class_exists('TCPDF')) { $j = 0; for ($i=0; $i < 256; $i++) { $t = $rc4[$i]; - $j = ($j + $t + ord($k{$i})) % 256; + $j = ($j + $t + ord($k[$i])) % 256; $rc4[$i] = $rc4[$j]; $rc4[$j] = $t; } @@ -5792,7 +5809,7 @@ if (!class_exists('TCPDF')) { $rc4[$a] = $rc4[$b]; $rc4[$b] = $t; $k = $rc4[($rc4[$a] + $rc4[$b]) % 256]; - $out .= chr(ord($text{$i}) ^ $k); + $out .= chr(ord($text[$i]) ^ $k); } return $out; } @@ -6188,7 +6205,15 @@ if (!class_exists('TCPDF')) { function SetLineWidth($width) { //Set line width $this->LineWidth = $width; - $this->linestyleWidth = sprintf('%.2f w', ($width * $this->k)); + //$this->linestyleWidth = sprintf('%.2f w', ($width * $this->k)); + // FrontAccounting fix + // My PHP 5.2.6 environment gave an "Unsupported operand types" + // error for the multiplication on the next line some of the + // time when this method is called - I debugged and sometimes + // the $width parameter is some sort of weird array. I don't + // understand what's going on, but casting it to a (float) seems + // to "fix" the problem. -Jason Maas, 2009/09/25 + $this->linestyleWidth = sprintf('%.2f w', ((float) $width * (float) $this->k)); $this->_out($this->linestyleWidth); } @@ -6247,7 +6272,7 @@ if (!class_exists('TCPDF')) { if (isset($dash)) { $dash_string = ""; if ($dash) { - if (ereg("^.+,", $dash)) { + if (preg_match("/^.+,/", $dash)) { $tab = explode(",", $dash); } else { $tab = array($dash); @@ -7698,6 +7723,9 @@ if (!class_exists('TCPDF')) { if (empty($this->javascript)) { return; } + // the following two lines are uded to avoid form fields duplication after saving + $js1 = sprintf("ftcpdfdocsaved=this.addField('%s','%s',%d,[%.2f,%.2f,%.2f,%.2f]);", 'tcpdfdocsaved', 'text', 0, 0, 1, 0, 1); + $js2 = "getField('tcpdfdocsaved').value = 'saved';"; $this->_newobj(); $this->n_js = $this->n; $this->_out('<<'); @@ -7707,7 +7735,7 @@ if (!class_exists('TCPDF')) { $this->_newobj(); $this->_out('<<'); $this->_out('/S /JavaScript'); - $this->_out('/JS '.$this->_textstring($this->javascript)); + $this->_out('/JS '.$this->_textstring($js1."\n".$this->javascript."\n".$js2)); $this->_out('>>'); $this->_out('endobj'); } @@ -7744,10 +7772,12 @@ if (!class_exists('TCPDF')) { * @since 2.1.002 (2008-02-12) */ function _addfield($type, $name, $x, $y, $w, $h, $prop) { + // the followind avoid fields duplication after saving the document + $this->javascript .= "if(getField('tcpdfdocsaved').value != 'saved') {"; $k = $this->k; $this->javascript .= sprintf("f".$name."=this.addField('%s','%s',%d,[%.2f,%.2f,%.2f,%.2f]);", $name, $type, $this->PageNo()-1, $x*$k, ($this->h-$y)*$k+1, ($x+$w)*$k, ($this->h-$y-$h)*$k+1)."\n"; $this->javascript .= "f".$name.".textSize=".$this->FontSizePt.";\n"; - while (list($key, $val) = each($prop)) { + foreach ($prop as $key => $val) { if (strcmp(substr($key,-5),"Color") == 0) { $val = $this->_JScolor($val); } else { @@ -7756,6 +7786,7 @@ if (!class_exists('TCPDF')) { $this->javascript .= "f".$name.".".$key."=".$val.";\n"; } $this->x += $w; + $this->javascript .= "}"; } /* @@ -8621,12 +8652,12 @@ if (!class_exists('TCPDF')) { $this->_out(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F cm', $scale_x, 0, 0, $scale_y, $x1*(1-$scale_x), $y2*(1-$scale_y))); } // handle pc/unix/mac line endings - $lines = split("\r\n|[\r\n]", $data); + $lines = preg_split("/\r\n|[\r\n]/", $data); $u=0; $cnt = count($lines); for ($i=0; $i < $cnt; $i++) { $line = $lines[$i]; - if (($line == '') OR ($line{0} == '%')) { + if (($line == '') OR ($line[0] == '%')) { continue; } $len = strlen($line); @@ -8677,7 +8708,7 @@ if (!class_exists('TCPDF')) { case 'V': case 'L': case 'C': { - $line{$len-1} = strtolower($cmd); + $line[$len-1] = strtolower($cmd); $this->_out($line); break; } @@ -9175,7 +9206,7 @@ if (!class_exists('TCPDF')) { // get tag name preg_match('/[\/]?([a-zA-Z0-9]*)/', $element, $tag); $dom[$key]['value'] = strtolower($tag[1]); - if ($element{0} == '/') { + if ($element[0] == '/') { // closing html tag $dom[$key]['opening'] = false; $dom[$key]['parent'] = end($level); @@ -9220,7 +9251,7 @@ if (!class_exists('TCPDF')) { // get attributes preg_match_all('/([^=\s]*)=["\']?([^"\']*)["\']?/', $element, $attr_array, PREG_PATTERN_ORDER); $dom[$key]['attribute'] = array(); // reset attribute array - while (list($id, $name) = each($attr_array[1])) { + foreach ($attr_array[1] as $id => $name) { $dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id]; } // split style attributes @@ -9228,14 +9259,14 @@ if (!class_exists('TCPDF')) { // get style attributes preg_match_all('/([^:\s]*):([^;]*)/', $dom[$key]['attribute']['style'], $style_array, PREG_PATTERN_ORDER); $dom[$key]['style'] = array(); // reset style attribute array - while (list($id, $name) = each($style_array[1])) { + foreach ($style_array[1] as $id => $name) { $dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]); } // --- get some style attributes --- if (isset($dom[$key]['style']['font-family'])) { // font family if (isset($dom[$key]['style']['font-family'])) { - $fontslist = split(",", strtolower($dom[$key]['style']['font-family'])); + $fontslist = preg_split("/,/", strtolower($dom[$key]['style']['font-family'])); foreach($fontslist as $font) { $font = trim(strtolower($font)); if (in_array($font, $this->fontlist)){ @@ -9284,10 +9315,10 @@ if (!class_exists('TCPDF')) { } // font style $dom[$key]['fontstyle'] = ""; - if (isset($dom[$key]['style']['font-weight']) AND (strtolower($dom[$key]['style']['font-weight']{0}) == "b")) { + if (isset($dom[$key]['style']['font-weight']) AND (strtolower($dom[$key]['style']['font-weight'][0]) == "b")) { $dom[$key]['fontstyle'] .= "B"; } - if (isset($dom[$key]['style']['font-style']) AND (strtolower($dom[$key]['style']['font-style']{0}) == "i")) { + if (isset($dom[$key]['style']['font-style']) AND (strtolower($dom[$key]['style']['font-style'][0]) == "i")) { $dom[$key]['fontstyle'] .= "I"; } // font color @@ -9303,9 +9334,9 @@ if (!class_exists('TCPDF')) { $decors = explode(" ", strtolower($dom[$key]['style']['text-decoration'])); foreach ($decors as $dec) { $dec = trim($dec); - if ($dec{0} == "u") { + if ($dec[0] == "u") { $dom[$key]['fontstyle'] .= "U"; - } elseif ($dec{0} == "l") { + } elseif ($dec[0] == "l") { $dom[$key]['fontstyle'] .= "D"; } } @@ -9320,14 +9351,14 @@ if (!class_exists('TCPDF')) { } // check for text alignment if (isset($dom[$key]['style']['text-align'])) { - $dom[$key]['align'] = strtoupper($dom[$key]['style']['text-align']{0}); + $dom[$key]['align'] = strtoupper($dom[$key]['style']['text-align'][0]); } } // check for font tag if ($dom[$key]['value'] == "font") { // font family if (isset($dom[$key]['attribute']['face'])) { - $fontslist = split(",", strtolower($dom[$key]['attribute']['face'])); + $fontslist = preg_split("/,/", strtolower($dom[$key]['attribute']['face'])); foreach($fontslist as $font) { $font = trim(strtolower($font)); if (in_array($font, $this->fontlist)){ @@ -9339,9 +9370,9 @@ if (!class_exists('TCPDF')) { // font size if (isset($dom[$key]['attribute']['size'])) { if ($key > 0) { - if ($dom[$key]['attribute']['size']{0} == "+") { + if ($dom[$key]['attribute']['size'][0] == "+") { $dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] + intval(substr($dom[$key]['attribute']['size'], 1)); - } elseif ($dom[$key]['attribute']['size']{0} == "-") { + } elseif ($dom[$key]['attribute']['size'][0] == "-") { $dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] - intval(substr($dom[$key]['attribute']['size'], 1)); } else { $dom[$key]['fontsize'] = intval($dom[$key]['attribute']['size']); @@ -9368,8 +9399,8 @@ if (!class_exists('TCPDF')) { if (($dom[$key]['value'] == "em") OR ($dom[$key]['value'] == "i")) { $dom[$key]['fontstyle'] .= "I"; } - if (($dom[$key]['value']{0} == "h") AND (intval($dom[$key]['value']{1}) > 0) AND (intval($dom[$key]['value']{1}) < 7)) { - $headsize = (4 - intval($dom[$key]['value']{1})) * 2; + if (($dom[$key]['value'][0] == "h") AND (intval($dom[$key]['value'][1]) > 0) AND (intval($dom[$key]['value'][1]) < 7)) { + $headsize = (4 - intval($dom[$key]['value'][1])) * 2; $dom[$key]['fontsize'] = $dom[0]['fontsize'] + $headsize; $dom[$key]['fontstyle'] .= "B"; } @@ -9411,7 +9442,7 @@ if (!class_exists('TCPDF')) { } // check for text alignment if (isset($dom[$key]['attribute']['align']) AND (!empty($dom[$key]['attribute']['align'])) AND ($dom[$key]['value'] !== 'img')) { - $dom[$key]['align'] = strtoupper($dom[$key]['attribute']['align']{0}); + $dom[$key]['align'] = strtoupper($dom[$key]['attribute']['align'][0]); } } // end opening tag } else { @@ -9456,12 +9487,12 @@ if (!class_exists('TCPDF')) { $yshift = 0; $startlinepage = $this->page; $newline = true; - if (isset($this->footerpos[$this->page])) { + if (isset($this->footerlen[$this->page])) { $this->footerpos[$this->page] = strlen($this->pages[$this->page]) - $this->footerlen[$this->page]; - $startlinepos = $this->footerpos[$this->page]; } else { - $startlinepos = strlen($this->pages[$this->page]); + $this->footerpos[$this->page] = strlen($this->pages[$this->page]); } + $startlinepos = $this->footerpos[$this->page]; $lalign = $align; $plalign = $align; if ($this->rtl) { @@ -9547,12 +9578,12 @@ if (!class_exists('TCPDF')) { // the last line must be shifted to be aligned as requested $linew = abs($this->endlinex - $startlinex); $pstart = substr($this->pages[$startlinepage], 0, $startlinepos); - if (isset($opentagpos) AND isset($this->footerpos[$startlinepage])) { + if (isset($opentagpos) AND isset($this->footerlen[$startlinepage])) { $this->footerpos[$startlinepage] = strlen($this->pages[$startlinepage]) - $this->footerlen[$startlinepage]; $midpos = min($opentagpos, $this->footerpos[$startlinepage]); } elseif (isset($opentagpos)) { $midpos = $opentagpos; - } elseif (isset($this->footerpos[$startlinepage])) { + } elseif (isset($this->footerlen[$startlinepage])) { $this->footerpos[$startlinepage] = strlen($this->pages[$startlinepage]) - $this->footerlen[$startlinepage]; $midpos = $this->footerpos[$startlinepage]; } else { @@ -9613,12 +9644,12 @@ if (!class_exists('TCPDF')) { $startlinepos = $endlinepos; unset($endlinepos); } else { - if (isset($this->footerpos[$this->page])) { + if (isset($this->footerlen[$this->page])) { $this->footerpos[$this->page] = strlen($this->pages[$this->page]) - $this->footerlen[$this->page]; - $startlinepos = $this->footerpos[$this->page]; } else { - $startlinepos = strlen($this->pages[$this->page]); + $this->footerpos[$this->page] = strlen($this->pages[$this->page]); } + $startlinepos = $this->footerpos[$this->page]; } $plalign = $lalign; $this->newline = false; @@ -9704,12 +9735,12 @@ if (!class_exists('TCPDF')) { } // add rowspan information to table element if ($rowspan > 1) { - if (isset($this->footerpos[$this->page])) { + if (isset($this->footerlen[$this->page])) { $this->footerpos[$this->page] = strlen($this->pages[$this->page]) - $this->footerlen[$this->page]; - $trintmrkpos = $this->footerpos[$this->page]; } else { - $trintmrkpos = strlen($this->pages[$this->page]); + $this->footerpos[$this->page] = strlen($this->pages[$this->page]); } + $trintmrkpos = $this->footerpos[$this->page]; $trsid = array_push($dom[$table_el]['rowspans'], array('rowspan' => $rowspan, 'colspan' => $colspan, 'startpage' => $this->page, 'startx' => $this->x, 'starty' => $this->y, 'intmrkpos' => $trintmrkpos)); } $cellid = array_push($dom[$trid]['cellpos'], array('startx' => $this->x)); @@ -9769,12 +9800,12 @@ if (!class_exists('TCPDF')) { } else { // opening tag (or self-closing tag) if (!isset($opentagpos)) { - if (isset($this->footerpos[$this->page])) { + if (isset($this->footerlen[$this->page])) { $this->footerpos[$this->page] = strlen($this->pages[$this->page]) - $this->footerlen[$this->page]; - $opentagpos = $this->footerpos[$this->page]; } else { - $opentagpos = strlen($this->pages[$this->page]); + $this->footerpos[$this->page] = strlen($this->pages[$this->page]); } + $opentagpos = $this->footerpos[$this->page]; } $this->openHTMLTagHandler($dom, $key, $cell); } @@ -9851,12 +9882,12 @@ if (!class_exists('TCPDF')) { // the last line must be shifted to be aligned as requested $linew = abs($this->endlinex - $startlinex); $pstart = substr($this->pages[$startlinepage], 0, $startlinepos); - if (isset($opentagpos) AND isset($this->footerpos[$startlinepage])) { + if (isset($opentagpos) AND isset($this->footerlen[$startlinepage])) { $this->footerpos[$startlinepage] = strlen($this->pages[$startlinepage]) - $this->footerlen[$startlinepage]; $midpos = min($opentagpos, $this->footerpos[$startlinepage]); } elseif (isset($opentagpos)) { $midpos = $opentagpos; - } elseif (isset($this->footerpos[$startlinepage])) { + } elseif (isset($this->footerlen[$startlinepage])) { $this->footerpos[$startlinepage] = strlen($this->pages[$startlinepage]) - $this->footerlen[$startlinepage]; $midpos = $this->footerpos[$startlinepage]; } else { @@ -10411,4 +10442,3 @@ if (!class_exists('TCPDF')) { //============================================================+ // END OF FILE //============================================================+ -?>