Hello,
You can use the template methods to work with a template DOCX and generate more than one output from an external content loading the same template for each output:
// iterate a data source to generate the documents
for ... {
$docx = new CreateDocxFromTemplate('template.docx');
// use template API methods to replace contents
(...)
// save the DOCX
$docx->createDocx($output);
}
as explained on:
https://www.phpdocx.com/documentation/practical/working-with-templates
https://www.phpdocx.com/documentation/practical/adding-content-to-a-template
Or use Bulk Processing (https://www.phpdocx.com/documentation/introduction/bulk-processing-documents-PHP) features available since phpdocx 10 in Premium licenses.
If you need to clone a whole DOCX you can use mergeDocx merging the same document as many times as needed: https://www.phpdocx.com/api-documentation/docxutilities/merge-Word-documents-with-PHP . This method includes an option to force a section page break (enforceSectionPageBreak), or you can add a page break using DOCXPath if needed with insertWordFragment (https://www.phpdocx.com/api-documentation/docx-path/insert-elements-in-docx).
Regards.