Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge multiple docx files #364

Open
jp-morvan opened this issue Sep 9, 2014 · 14 comments
Open

Merge multiple docx files #364

jp-morvan opened this issue Sep 9, 2014 · 14 comments

Comments

@jp-morvan
Copy link

jp-morvan commented Sep 9, 2014

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.

@jp-morvan
Copy link
Author

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 !

@wdog
Copy link

wdog commented Oct 14, 2015

it is now possible to merge 2 or more documents?

@mariahaubner
Copy link
Contributor

friendly bump :)

@arcanedev-maroc
Copy link

Please, somebody give us a response/solution !

I want to merge multiple docx files into one file.

@Ventto
Copy link

Ventto commented Sep 26, 2016

It is now possible to merge 2 or more documents like PHPDocx ?

@EasySoftwarePoland
Copy link

Just found a simple solution: https://github.com/krustnic/DocxMerge
But it is not working under Libreoffice/Openoffice and word2003

@sambenne
Copy link

sambenne commented Nov 3, 2017

Bump, is anything like this possible yet?

@troosan
Copy link
Contributor

troosan commented Nov 10, 2017

Not out of the box. feel free to contribute :-)

@PavelZurek
Copy link

+1

@Jv1i3n
Copy link

Jv1i3n commented Apr 3, 2018

I proposed a solution on this pull request

@SomayaMomtaz
Copy link

i'm asking the same question
#1333

@chrisribe
Copy link

Same here any instructions on how to append existing documents together ?

@noukaza
Copy link

noukaza commented Aug 5, 2020

i'm asking the same question

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@github-actions github-actions bot added the Stale label Nov 18, 2022
@Progi1984 Progi1984 removed the Stale label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests