Hi,
I am trying to preserve line breaks taken from database content to a newly generated .docx document. Basically, I have entries in the database similar to the following:
blabalabalalalala
* bala
*bala
when the above text is put using addText($var), the line breaks seem to be removed. Hence I did the following:
$Question = array();
$QuestionArray = explode("\n",$content['Question'][$i]);
$i = 0;
foreach($QuestionArray as $QA){
if ($i > 0){
$Question[] = array('text'=>$QA,'lineBreak'=>true);
} else {
$Question[] = array('text'=>$QA);
}
}
$temp = $Docx->addText($Question,array('rawWordML'=>true));
$col4 = $Docx->createWordMLFragment($temp);
$Table[] = array($col4,$col5,$col6,$col7);
$TableOptions = array('size_col'=>array(400,400,400,400,400,400,400));
$TableProperties = array();
$TableProperties[0] = array('tableHeader'=>true);
$Docx->addTable($Table, $TableOptions, $TableProperties);
As you can see, I'd like to put the result in the table. Unfortunately, that code fragment seems to drain a huge memory resource. Any idea on how to fix this ?