From decca70ff5c0283d579a40c07396a954b9aaf26f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 31 Jul 2009 19:55:20 +0000 Subject: [PATCH] Fix: refocusing footer and free text --- htdocs/lib/functions.lib.php | 2 +- htdocs/lib/pdf.lib.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 2a7fb44ba82..433ff674531 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -2641,7 +2641,7 @@ function dol_nboflines_bis($texte,$maxlinesize=0) { $repTable = array("\t" => " ", "\n" => "
", "\r" => " ", "\0" => " ", "\x0B" => " "); $texte = strtr($texte, $repTable); - $pattern = '/(<[^>]+>)/Uu'; + $pattern = '/(<[^>]+>)/'; $a = preg_split($pattern, $texte, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); $nblines = floor((count($a)+1)/2); // count possible auto line breaks diff --git a/htdocs/lib/pdf.lib.php b/htdocs/lib/pdf.lib.php index 332ce854ca1..2bfa670eb0d 100644 --- a/htdocs/lib/pdf.lib.php +++ b/htdocs/lib/pdf.lib.php @@ -178,13 +178,13 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass // On positionne le debut du bas de page selon nbre de lignes de ce bas de page $nbofligne=dol_nboflines_bis($ligne); //print 'e'.$ligne.'t'.dol_nboflines($ligne);exit; - $posy=$marge_basse + ($nbofligne*3) + ($ligne1?3:0) + ($ligne2?3:0); + $posy=$marge_basse + ($nbofligne*4) + ($ligne1?3:0) + ($ligne2?3:0); if ($ligne) // Free text { - $pdf->SetXY($marge_gauche,-$posy); - $pdf->MultiCell(20000, 3, $ligne, 0, 'L', 0); // Use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text. - $posy-=($nbofligne*3); // 6 of ligne + 3 of MultiCell + $pdf->SetXY($marge_gauche-5,-$posy); + $pdf->MultiCell(200, 3, $ligne, 0, 'C', 0); // Use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text. + $posy-=($nbofligne*4); // 6 of ligne + 3 of MultiCell } $pdf->SetY(-$posy); @@ -193,14 +193,14 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass if ($ligne1) { - $pdf->SetXY($marge_gauche,-$posy); + $pdf->SetXY($marge_gauche-5,-$posy); $pdf->MultiCell(200, 2, $ligne1, 0, 'C', 0); } if ($ligne2) { $posy-=3; - $pdf->SetXY($marge_gauche,-$posy); + $pdf->SetXY($marge_gauche-5,-$posy); $pdf->MultiCell(200, 2, $ligne2, 0, 'C', 0); }