News
Textboxes with PHPdocx
- May 03, 2011
This information is outdated, please, refer to the addTextBox documentation for up to date info.
Do you need to insert a text box into your Word document? With PHPdocx is easy: you pass the text and format using a variable and an array as follows:
require_once '../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$paramsText = array(
'b' => 'single',
'font' => 'Arial'
);
$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.';
$paramsTextBox = array(
'jc' => 'through'
);
$docx->addTextBox(
array(
'text' => $text,
'args' => $paramsText
),
$paramsTextBox
);
$docx->createDocx('example_textbox');