
text : Text to insert into the document
$paramsText
text : creating a multi-format text 
require_once 'classes/CreateDocx.inc';
$docx = new CreateDocx();
$text = '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.';
$paramsText = array(
'b' => 'single',
'font' => 'Arial'
);
$docx->addText($text, $paramsText);
$docx->createDocx('example_text');

require_once('classes/CreateDocx.inc');
$docx = new CreateDocx();
$text = array();
$text[] =
array(
'text' => 'Lorem ipsum',
'u' => 'single',
);
$text[] =
array(
'text' => ' sed do eiusmod tempor incididunt',
'b' => 'single',
);
$docx->addText($text);
$docx->createDocx('example_text');
8 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
Most of the examples appear to work fine - a most interesting product. Will the PRO version only work on one site? - the documentation is ambiguous as it says it will only work on one but then asks for a list of sites.
Is there any way of altering the spacing between paragraphs? Generated documents have a 10pt space after every paragraph - this is not my default so it must be specified in one of your class scripts.
At the moment fAddText always starts a new paragraph. Any way of changing this?
It’s possible to move the text by some distance away from the start?
hey is there any option for line spacing???