Inserting line breaks into PDF

前端 未结 13 1679
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 12:34

I\'m generating some PDF file on the fly using PHP. My problem is I need to insert line breaks in some part of the text that will be inserted in the PDF file. Something like

13条回答
  •  眼角桃花
    2020-11-30 12:44

    I have simply replaced the "\n" with "
    " tag. Worked fine. It seems TCPDF render the text as HTML

    $strText = str_replace("\n","
    ",$strText); $pdf->MultiCell($width, $height,$strText, 0, 'J', 0, 1, '', '', true, null, true);

提交回复
热议问题