Inserting line breaks into PDF

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

    Another solutions (works with TCPDF)

    Use HEREDOC for a long string. Put HERDOC for a CONST for example (define different languages)

    $_prepare_const_EN = <<<EOT
    this is a long string
    and new line as well ...
    EOT;
    
    $define('STR_EN', $_prepare_const_EN);
    
    $pdf->InsertText(STR_EN);
    

    works for me wery well....

    0 讨论(0)
提交回复
热议问题