News

Add a page in the footer of your Word document with PHPdocx

  • 06 / 06 / 2011

This information is outdated, please, refer to the addPageNumber documentation for up to date info.
Do you need to include page numbers in the Word document footer?
Learn how to do it with this sample code:


require_once('../../classes/CreateDocx.inc');

$docx = new CreateDocx();

$docx->addText('Page 1 Content');
$docx->addBreak('page');

$docx->addText('Page 2 Content');
$docx->addBreak('page');

$docx->addText('Page 3 Content');

$paramsFooter = array(
'font' => 'Arial',
'pager' => 'true',
'pagerAlignment' => 'right'
);

$docx->addFooter('Footer. Arial font', $paramsFooter);

$docx->createDocx('example_footer_pager');