Merge and split documents with GroupDocs.Merger
Leave feedback
On this page
GroupDocs.Merger combines documents and rearranges their pages — join, split, extract, remove, reorder, rotate — and manages document passwords. It works on Word, PDF, spreadsheets, presentations, images and archives.
Warning
Save needs an absolute output path. Given a relative one it does nothing at all — no file, no exception, no error code:
merger.Save("merged.docx");// returns cleanly, writes nothingmerger.Save(Path.GetFullPath("merged.docx"));// writes the file
Input paths passed to the constructor and to Join may be relative. Only the output path must be absolute, which is why every example below wraps it in Path.GetFullPath.
Join two documents
Join appends another document to the one you opened. Call it repeatedly to combine several, then Save.
GroupDocs.Merger also splits one document into several, removes, moves, swaps and rotates pages, changes page orientation, adds, updates and removes document passwords, generates page previews, and offers a fluent API for chaining operations.