
text : Text to insert into the document
$arrParamsText
text : creating a multi-format text 
require_once('../classes/cCreateDocx.inc');
$objDocx = new cCreateDocx();
$arrParamsText = array(
'b' => 'single'
);
$objDocx->fAddText('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', $arrParamsText);
$objDocx->fCreateDocx('ejemplo_texto');
require_once('../classes/cCreateDocx.inc');
$objDocx = new cCreateDocx();
$arrParamsText = array(
'u' => 'single',
'pageBreakBefore' => 'on'
);
$objDocx->fAddText('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', $arrParamsText);
$objDocx->fCreateDocx('ejemplo_texto');

require_once('../classes/cCreateDocx.inc');
$objDocx = new cCreateDocx();
$arrText = array();
$arrText[] =
array(
'text' => 'Lorem ipsum ',
'u' => 'single',
);
$arrText[] =
array(
'text' => ' sed do eiusmod tempor incididunt'
);
$objDocx->fAddText($arrText);
$objDocx->fCreateDocx('example_text_multi');
5 Responses
Hello,
Is it possible possible to change the style of a part of a text in the same paragraph ?
fAddText(’Start of the line without style’);
$arrParamsText = array(
‘b’ => ’single’
);
$objDocx->fAddText(’ the line continue without return to line ?’,$arrParamsText);
?>
If I write two fAddText methods, I have a return to line in my sentence
Regards,
Hi,
The next version of phpdocx will include this feature. We’re working actually on it.
how would I go about making text within a table cell bold?
Cant get this to work with line feeds. What characters will it convert into line feeds?
This looks like a promising product. However, it would be good to have a users forum.
I would be interested to buy a license if I would be able to get the example files to work.
Even the simple ‘hello world’ example is not working. GEt the error :syntax error, unexpected T_STRING, expecting ‘)’. (error comes from $objDocx->fAddText)
There is a big need for such a product but PLEASE PROVIDE A FORUM. I have been purchasing too many softwares that I never used. So, put us in a position to share experience between users and you will see your sales boosting !
Support is maybe an important revenue source but make sure your cutomers can first have a good expecience with the product.
Mutske