Hello,
You need to use your template to generate as many DOCX documents as needed (for example one document for each page you want in the final DOCX) replacing the image/placeholder by the new QR using replacePlaceholderImage or replaceVariableByWordFragment. And then merge them into a single document using mergeDocx, the numbering option of this method allows continue and restart the numbering.
If the final DOCX has a placeholder that appear more than one time, and it needs to be replaced by unique contents, the firstMatch option available in replace methods can be used.
Regards.