diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index e3818af190c..d7ae1cd1440 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3249,7 +3249,7 @@ function dol_nboflines($s,$maxchar=0)
/**
- * Return nb of lines of a formated text with \n and
+ * Return nb of lines of a formated text with \n and
(we can't have both \n and br)
*
* @param string $text Text
* @param int $maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut)
@@ -3258,8 +3258,9 @@ function dol_nboflines($s,$maxchar=0)
*/
function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8')
{
- //print $text;
$repTable = array("\t" => " ", "\n" => "
", "\r" => " ", "\0" => " ", "\x0B" => " ");
+ if (dol_textishtml($text)) $repTable = array("\t" => " ", "\n" => " ", "\r" => " ", "\0" => " ", "\x0B" => " ");
+
$text = strtr($text, $repTable);
if ($charset == 'UTF-8') { $pattern = '/(<[^>]+>)/Uu'; } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support
else $pattern = '/(<[^>]+>)/U'; // /U is to have UNGREEDY regex to limit to one html tag.
diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
index a8117d80cfe..91f4b18c172 100644
--- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
+++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
@@ -227,7 +227,7 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY);
- $pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also.
+ $pdf->MultiCell(0, 2, ''); // Set interline to 3. Then writeMultiCell must use 3 also.
$nblines = count($object->lines);
@@ -244,14 +244,27 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->SetFont('','B', $default_font_size - 1);
$pdf->SetXY($this->marge_gauche, $curY);
$txt=dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output);
+
+ $curYold=$nexYold=$nexY;
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $txt, 0, 1, 0);
$curY = $pdf->GetY();
- $pdf->SetFont('','', $default_font_size - 1);
+ $nexY+=3;
- $pdf->SetXY($this->marge_gauche, $curY + 3);
+ $pdf->SetFont('','', $default_font_size - 1);
+
+ $pdf->SetXY($this->marge_gauche, $nexY);
$desc = dol_htmlentitiesbr($objectligne->desc,1);
- $pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY + 3, $desc, 0, 1, 0);
- $nexY+=dol_nboflines_bis($objectligne->desc,52,$outputlangs->charset_output)*3;
+
+ $curYold = $pdf->GetY();
+ $nexYold = $curYold;
+
+ $pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $desc, 0, 1, 0);
+
+ $stringheight=$pdf->getStringHeight('A', $txt);
+ $curY = $pdf->GetY();
+
+ $nexY+=(dol_nboflines_bis($objectligne->desc,0,$outputlangs->charset_output)*$stringheight);
+ //print $curYold."-".$nexYold." +".dol_nboflines_bis($objectligne->desc,52,$outputlangs->charset_output)."*".$stringheight."= ".$curY."-".$nexY."
";
$nexY+=2; // Passe espace entre les lignes