Fix: refocusing footer and free text
This commit is contained in:
parent
d55e388fd3
commit
decca70ff5
@ -2641,7 +2641,7 @@ function dol_nboflines_bis($texte,$maxlinesize=0)
|
|||||||
{
|
{
|
||||||
$repTable = array("\t" => " ", "\n" => "<br>", "\r" => " ", "\0" => " ", "\x0B" => " ");
|
$repTable = array("\t" => " ", "\n" => "<br>", "\r" => " ", "\0" => " ", "\x0B" => " ");
|
||||||
$texte = strtr($texte, $repTable);
|
$texte = strtr($texte, $repTable);
|
||||||
$pattern = '/(<[^>]+>)/Uu';
|
$pattern = '/(<[^>]+>)/';
|
||||||
$a = preg_split($pattern, $texte, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
$a = preg_split($pattern, $texte, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
||||||
$nblines = floor((count($a)+1)/2);
|
$nblines = floor((count($a)+1)/2);
|
||||||
// count possible auto line breaks
|
// count possible auto line breaks
|
||||||
|
|||||||
@ -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
|
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
|
||||||
$nbofligne=dol_nboflines_bis($ligne);
|
$nbofligne=dol_nboflines_bis($ligne);
|
||||||
//print 'e'.$ligne.'t'.dol_nboflines($ligne);exit;
|
//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
|
if ($ligne) // Free text
|
||||||
{
|
{
|
||||||
$pdf->SetXY($marge_gauche,-$posy);
|
$pdf->SetXY($marge_gauche-5,-$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.
|
$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*3); // 6 of ligne + 3 of MultiCell
|
$posy-=($nbofligne*4); // 6 of ligne + 3 of MultiCell
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetY(-$posy);
|
$pdf->SetY(-$posy);
|
||||||
@ -193,14 +193,14 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
|
|||||||
|
|
||||||
if ($ligne1)
|
if ($ligne1)
|
||||||
{
|
{
|
||||||
$pdf->SetXY($marge_gauche,-$posy);
|
$pdf->SetXY($marge_gauche-5,-$posy);
|
||||||
$pdf->MultiCell(200, 2, $ligne1, 0, 'C', 0);
|
$pdf->MultiCell(200, 2, $ligne1, 0, 'C', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ligne2)
|
if ($ligne2)
|
||||||
{
|
{
|
||||||
$posy-=3;
|
$posy-=3;
|
||||||
$pdf->SetXY($marge_gauche,-$posy);
|
$pdf->SetXY($marge_gauche-5,-$posy);
|
||||||
$pdf->MultiCell(200, 2, $ligne2, 0, 'C', 0);
|
$pdf->MultiCell(200, 2, $ligne2, 0, 'C', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user