Your data is encoded from a Flex/Air program
Data have line breaks (typed in memo box for example)
Would want to print data to PDF file
Problem:
Data won't print with line breaks. Grrrrrrrr...
My Solution:
// Setting line breaks on string from a text area
function setLineBreaksPDF($s="") {
$s = nl2br($s);
$s = str_replace("<br />", "\n", $s);
return $s;
}
function setLineBreaksPDF($s="") {
$s = nl2br($s);
$s = str_replace("<br />", "\n", $s);
return $s;
}
I'm not sure if there are any other work around for this problem that I had encountered. And I can't understand why would I need to nl2br the data, and would bring back \n. But that works to me.
RSS Feed 


0 comments:
Post a Comment