Categories > OpenTBS with DOCX >

Merge 2 docx files

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Dave
Date: 2011-04-05
Time: 05:13

Merge 2 docx files

Hi there,

I've read through the docs, but haven't been able to find the functionality (or an example) on how to merge 2 docx documents.

Basically i just want to append a docx document to the bottom of another docx document.

Is this possible with Open TBS, would it be as simple as loading 2 templates, then saving the data to a file?

Thanks!
Dave
By: Skrol29
Date: 2011-04-05
Time: 21:17

Re: Merge 2 docx files

Hi Dave,

Can can be simple as it ca be difficult.
Each Docx contents has a XML header and a XML footer. You first have to insert the second inner XML at the bottom of the first inner XML.
But unfortunately it may have other difficulties:
- what if one of the document has a Ms Word header of a footer section ? which one will you choose?
- what if the second document has different styles for paragraphs?
- you will also have to check for pictures and load them from the second document to the first one too.