Hello,
We are trying to replace a variable inside a DOCX template with the page number of the document.
We tried the following code:
$pageNumberFragment = new WordFragment($this->docx, "defaultFooter");
$pageNumberFragment->addPageNumber();
$this->docx->replaceVariableByWordFragment([
"pageNumber" => $pageNumberFragment
], [
"target" => "footer",
"type" => "inline"
]);
But the resulting DOCX does not have a merge field, ony a "1" simple text.
Is this a limitation of our phpdocx version, or are we doing something wrong?
We have the advanced license for 7.5.
Thank you in advance.