Merge files

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Merger MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-merger -- dnx GroupDocs.Merger.Mcp --yes
Folders, licensing and more →

GroupDocs.Merger for Python via .NET lets you combine multiple documents of the same family into a single output file with just a few lines of Python code. All content — text, images, tables, graphs, forms, and embedded objects — is faithfully preserved in the result.

The library handles the complexities of each file format internally, so you do not need to understand proprietary format internals or rely on any third-party desktop software. The API is identical regardless of format: load the base document with Merger, call join once for every additional file, then call save.

Note

Try online

You can try merging files online and download the results for free using GroupDocs.Merger Live Demo.

Steps to merge documents

  1. Install the package: pip install groupdocs-merger-net.
  2. Import Merger from groupdocs.merger.
  3. Open the first (base) document with Merger("./input.<ext>") inside a with block.
  4. Call merger.join("./input2.<ext>") for each additional document to append.
  5. Call merger.save("./output.<ext>") to write the combined result.

Supported formats

See the full list in Supported Document Formats.

Per-format guides

Choose the guide for the format you want to merge:

See also