News

Simple example: how to use text in italics

  • 06 / 03 / 2011

This information is outdated, please, refer to the addText documentation for up to date info.
Do you need to write some text in italics?
Here it goes:


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.';

// check parameters "sz" (size) and "color" on hexadecimal (web colors)
$paramsText = array(
'i' => 'single',
'jc' => 'distribute',
'sz' => 14,
'color' => '76923C'
);
$docx->addText($text, $paramsText);

$docx->createDocx('example_text_cursive');