php - fpdf line break not working -
i have knockout observable contains text has line breaks in it.
like this:
var str += item.first_name + " " + item.last_name + "," + item.occupation + "\n\n"; str += "re :" + item.first_name + " " + item.last_name + ", dob: " + item.date_of_birth + "\n"; text = ko.observable(str);
the method using display string is:
$pdf->multicell(0,8,$text);
the result in pdf :
dr. bart grahamson,mbbsre :jack junior, dob: 1985-01-02
what way catch line breaks?
use \n , \r.
var str += item.first_name + " " + item.last_name + "," + item.occupation + "\n \r\r \n"; str += "re :" + item.first_name + " " + item.last_name + ", dob: " + item.date_of_birth + "\n \r"; text = ko.observable(str);