I am trying to create a single line footer with text, two links, a date and a page number. Everything works fine when I use 'numbering' as the type parameter for the page numbers but when I try to use 'page-of' it generates the output twice.
Here is a simplified version of the code for my footer that still demonstrates the issue:
require_once 'classes/CreateDocx.php';
$docx = new CreateDocx();
$numbering = new WordFragment($docx);
$numbering->addPageNumber('page-of');
$ftr = array();
$ftr[] = array('text' => 'Generic footer text ');
$ftr[] = $numbering;
$footerWordFragment = new WordFragment($docx);
$footerWordFragment->addText($ftr);
$docx->addFooter(array('default' => $footerWordFragment));
$docx->addText('This is the first page.');
$docx->addBreak(array('type' => 'page'));
$docx->addText('This is the second page.');
$docx->addBreak(array('type' => 'page'));
$docx->addText('This is the third page.');
$docx->createDocx('output');