Inserting line breaks into PDF

前端 未结 13 1725
佛祖请我去吃肉
佛祖请我去吃肉 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:35

    Your code reads

    $pdf->InsertText('Line one\n\nLine two');
    

    I don't know about the PDF library you're using but normally if you want \n to be interpreted as a line break you must use double quotes in PHP, e.g.

    $pdf->InsertText("Line one\n\nLine two");
    

提交回复
热议问题