Enter your email address:

    Delivered by FeedBurner

Friday, May 22, 2009

PHP, Flex: Printing Memo Data With Line Breaks to PDF from Flex Program

Situation:
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;
}



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.

0 comments:

Post a Comment

About Me

My photo
I provide health supplements, adult wellness products, glutathione, and other merchandise. Please visit my online shop at: http://luckycowshop.blogspot.com/