how to convert p tag to line break in php fpdf
379
I have the following for setting up the body of my fpdf:
function PrintChapter($num, $title, $date,$url,$Summery,$file,$byauthor){
$this->AddPage();
$this->SetDate(date("l F d, Y",strtotime($date)));
$this->Main_Full_TITLE($title);
//$this->PrintMainTitle("1",$title);
if($url){
$this->ChapterImage_H_W($url);
}else{
if($Summery){
$this->y0 = $this->GetY()-13;
}else{
$this->y0 = $this->GetY()-30;
}
}
$this->ChapterHead($Summery,$byauthor);
//$this->ChapterTitle($num,$title);
$this->ChapterBody($file);
}
function ChapterBody($file){
$txt = $file;
$this->SetFont('Arial','',12);
$this->MultiCell(92,5,$txt);
$this->Ln();
if($this->col==0){
$this->Line(10, $this->GetY(), 100, $this->GetY());
} else {
$this->Line($this->GetX(), $this->GetY(), $this->GetX()+90, $this->GetY());
}
$this->Ln();
}
$pdf->PrintChapter(1,$title,$PostData['post_date'],$url[0],$Summery,$MyContent,@implode(", ",$BYAuthorName));
The problem, is that my paragraphs do not have a big enough line space between and don't look like line breaks at all. How can I make the line breaks more distinct to show more paragraph formatting.
Answer
Solution:
You can pass an individual height to the Ln() method. If nothing is passed the last height of a cell is used. Which is
5
in your case (defined as 2nd parameter of the MultiCell() call).You can control the line height/height of a line break with both parameters.