Hello,
With a Premium license you can use in-memory DOCX documents:
// this object can be serialized (in memory, database, file system...) to be reused later
$docxStructure = new DOCXStructure();
$docxStructure->parseDocx('document.docx');
$docx = new CreateDocxFromTemplate($docxStructure);
or generate a DOCXStructure object (this approach uses stream_get_contents to get a stream but it also generates a local temp file with the DOCX, needed by ZipArchive):
$docxStructureStream = new DOCXStructureFromStream();
$docxStructure = $docxStructureStream->generateDOCXStructure('http://www.phpdocx.com/files/samples/TemplateSimpleText.docx');
$docx = new CreateDocxFromTemplate($docxStructure);
On https://www.phpdocx.com/documentation/cookbook/in-memory-docx-documents you can read more information about these methods.
Regards.