如何在 PHP FPD 中将 P 标签转换为换行符


how to convert p tag to line break in php fpdf

我有以下设置我的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));

问题是我的段落之间没有足够大的行距,看起来根本不像换行符。 如何使换行符更明显以显示更多段落格式。

您可以将单个高度传递给 Ln() 方法。如果未传递任何内容,则使用单元格的最后一个高度。这在您的情况下5(定义为 MultiCell() 调用的第二个参数)。

您可以使用这两个参数控制换行符的行高/高度。