Example #1
0
			$largeur_dispo=210-$pdf->GetX()-10;
		}

		debug_lettre_pdf("\$h_cadre[$type_lettre][$cpt_i_cadre]=".$h_cadre[$type_lettre][$cpt_i_cadre]."\n");

		$compte_retours_ligne=strlen(preg_replace("/[^\n]/","",$text));

		// La hauteur est en cm
		if((is_numeric($h_cadre[$type_lettre][$cpt_i_cadre]))&&($h_cadre[$type_lettre][$cpt_i_cadre]>0)) {
			$h_cell=$h_cadre[$type_lettre][$cpt_i_cadre]*10;
		}
		else {
			//$h_cell=50;
			// On essaye de calculer une hauteur fonction du nombre de retours à la ligne
			// en controlant que cela tient
			$h_cell=min($compte_retours_ligne*7, 297-$pdf->getY()-10);
		}

		//$largeur_underscore = $pdf->GetStringWidth("__________")/10;
		//$text=preg_replace("/______________________________/","_____________________________ ",$text);
		//$text=preg_replace("/__/","_ ",$text);

		// Les retours à la ligne ne sont pas pris en compte sans ça:
		$text=nl2br($text);
		//$text.=" ".$compte_retours_ligne;

		//cell_ajustee($text,$pdf->GetX(),$pdf->GetY(),$largeur_dispo,$h_cell,$taille_max_police,$taille_min_police,'LRBT');
		cell_ajustee($text,$pdf->GetX(),$pdf->GetY(),$largeur_dispo,$h_cell,$taille_max_police,$taille_min_police,$encadre_cadre[$type_lettre][$cpt_i_cadre]);
		//$pdf->Cell($largeur_dispo, $h_cell, $text,'TLRB',0,'L', '');

		$cpt_i_cadre = $cpt_i_cadre + 1;