Hi,
I'm trying to merge multiple docx files by adding page break in section but the file is always empty.
$document = new \PhpOffice\PhpWord\PhpWord();
$final_document = \PhpOffice\PhpWord\IOFactory::createWriter($document, 'Word2007');
$section = $document->createSection(($i=0));
foreach($files as $file)
{
$_document = $document->loadTemplate($file);
$section->addPageBreak();
}
$final_document->save($filename);
Thank you
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Hi,
Just to know if it's a bug, if it's not make for or if it's planned to add it to phpword ?
Thank you for this library !
it is now possible to merge 2 or more documents?
_friendly bump_ :)
Please, somebody give us a response/solution !
I want to merge multiple docx files into one file.
It is now possible to merge 2 or more documents like PHPDocx ?
Just found a simple solution: https://github.com/krustnic/DocxMerge
But it is not working under Libreoffice/Openoffice and word2003
Bump, is anything like this possible yet?
Not out of the box. feel free to contribute :-)
+1
I proposed a solution on this pull request
i'm asking the same question
https://github.com/PHPOffice/PHPWord/issues/1333
Same here any instructions on how to append existing documents together ?
i'm asking the same question
Most helpful comment
Just found a simple solution: https://github.com/krustnic/DocxMerge
But it is not working under Libreoffice/Openoffice and word2003