2
0
forked from Wavyzz/dolibarr

No limit on free text on PDF

This commit is contained in:
Laurent Destailleur
2009-01-12 17:23:12 +00:00
parent f31fd284a7
commit f1f4dd2f9b
2 changed files with 11 additions and 8 deletions

View File

@@ -804,13 +804,15 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
$pdf->SetDrawColor(224,224,224);
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
$posy=$marge_basse + 1 + ($ligne?6:0) + ($ligne1?3:0) + ($ligne2?3:0);
$nbofligne=dol_nboflines($ligne);
//print 'e'.$ligne.'t'.dol_nboflines($ligne);exit;
$posy=$marge_basse + ($nbofligne*3) + ($ligne1?3:0) + ($ligne2?3:0);
if ($ligne)
{
$pdf->SetXY($marge_gauche,-$posy);
$pdf->MultiCell(190, 3, $ligne, 0, 'L', 0);
$posy-=9; // 6 of ligne + 3 of MultiCell
$posy-=($nbofligne*3); // 6 of ligne + 3 of MultiCell
}
$pdf->SetY(-$posy);

View File

@@ -2529,13 +2529,14 @@ function dol_string_is_good_iso($s)
/**
* \brief Return nb of lines of a text
* \brief Return nb of lines of a clear text
* \param s String to check
* \param maxchar Not yet used
* \return int 0 if bad iso, 1 if good iso
* \return int Number of lines
*/
function dol_nboflines($s,$maxchar=0)
{
if ($s == '') return 0;
$arraystring=split("\n",$s);
$nb=sizeof($arraystring);
@@ -2544,12 +2545,12 @@ function dol_nboflines($s,$maxchar=0)
/**
* \brief Fonction retournant le nombre de lignes dans un texte formate
* \param texte Texte
* \brief Return nb of lines of a formated text with \n and <br>
* \param texte Text
* \param maxlinesize Largeur de ligne en caracteres(ou 0 si pas de limite - defaut)
* \return nblines Nombre de lignes
* \return int Number of lines
*/
function num_lines($texte,$maxlinesize=0)
function dol_nboflines_bis($texte,$maxlinesize=0)
{
$repTable = array("\t" => " ", "\n" => "<br>", "\r" => " ", "\0" => " ", "\x0B" => " ");
$texte = strtr($texte, $repTable);