Merge Word documents
How to merge DOC documents
GroupDocs.Merger provides an easy way to merge Microsoft Word documents of DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF formats and Open Document formats like ODT, OTT etc. It takes just single line of code to append one document to another preserving all content - page setup, headers and footers, formatting, styles and other content. There is no third-party applications required (like Microsoft Word and Open Office).
- join(String) - allows to merge document provided via file path on a local disk;
- join(InputStream) - provides an ability to combine documents loaded from any source - memory stream, remote URL etc.;
- join(String, IJoinOptions) - is used for merging specific pages for document stored at local disk;
- join(InputStream, IJoinOptions) - used for merging specific pages from document provided as a stream.
This code sample shows how to merge Microsoft Word documents:
Merger merger = new Merger(@"c:\document1.doc"); merger.join(@"c:\document2.doc"); merger.save(@"c:\merged.doc");
Please find more use-cases and complete Java sources of our backend and frontend examples and try them for free!