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.

423

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 is5 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.

People are also looking for solutions to the problem: php - Data is not getting stored in database for multiple check box in laravel

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.