FPDF - WriteHTML in Multicell?

前端 未结 6 1135
情书的邮戳
情书的邮戳 2021-01-03 13:12

Can WriteHTML placed in Multicell? How?

I retrieved and display the HTML output from database but want to position it in the 2nd column(let\'s say) so I put it in Mu

6条回答
  •  南方客
    南方客 (楼主)
    2021-01-03 13:35

    Add this method to your WriteHTML class

    function WriteHtmlCell($cellWidth, $html){        
        $rm = $this->rMargin;
        $this->SetRightMargin($this->w - $this->GetX() - $cellWidth);
        $this->WriteHtml($html);
        $this->SetRightMargin($rm);
    }
    

    then just call it

    $pdf->WriteHtmlCell(70, $html);
    

提交回复
热议问题