GroupDocs.Merger for Python via .NET Overview

What is GroupDocs.Merger?

GroupDocs.Merger for Python via .NET is a native Python library that merges, splits, and reorganises documents across 70+ supported formats — DOCX, PDF, XLSX, PPTX, images, Visio diagrams, eBooks, archives, and more. It runs entirely on-premise, requires no Microsoft Office or Adobe Acrobat installation, and ships as a pre-built wheel on Windows, Linux, and macOS.

Typical uses include:

  • Multi-document consolidation — assemble a single report or package from multiple source files in one API call.
  • Selective page merges — pull specific pages or page ranges from several documents and combine them into a new document.
  • Document assembly automation — build dynamic documents programmatically as part of batch or pipeline workflows.
  • Access control — protect sensitive documents with passwords and manage password changes or removal.
  • Page-level preparation — reorder, rotate, extract, or remove individual pages before a document reaches its final destination.

Key Capabilities

CapabilityDescription
Merge / JoinCombine two or more documents — or selected pages from them — into a single output file. See Merge Files.
SplitDivide a document into individual pages or multi-page segments by page list or interval. See Split Document.
Page OperationsExtract, remove, swap, or move pages within a document. See Single Document Operations.
Rotation / OrientationRotate pages 90°, 180°, or 270° and change page orientation between portrait and landscape. See Rotate Pages and Change Page Orientation.
Password SecurityAdd, update, remove, or check document passwords without opening the document in an editor. See Security Operations.
Page PreviewGenerate PNG, JPEG, or BMP thumbnail images of individual document pages. See Page Preview.
Document InspectionRead file type, page count, page dimensions, and other metadata without modifying the document. See Get Document Information.

Quick Example

Merge two PDF files into a single document with just a few lines of code:

from groupdocs.merger import Merger

def merge_pdf_documents():
    # Load the first PDF as the merge base
    with Merger("./input.pdf") as merger:
        # Append the second PDF
        merger.join("./input2.pdf")
        # Save the merged PDF
        merger.save("./output.pdf")

if __name__ == "__main__":
    merge_pdf_documents()

input.pdf is a sample file used in this example. Click here to download it.

input2.pdf is a sample file used in this example. Click here to download it.

Binary file (PDF, 418 KB)

Download full output

For finer control, use the *JoinOptions classes to join only selected pages and preserve PDF bookmarks:

from groupdocs.merger import Merger
from groupdocs.merger.domain.options import PageJoinOptions, PdfJoinOptions

def merge_pdf_with_options():
    # Load the first PDF as the merge base
    with Merger("./input.pdf") as merger:
        # Append only pages 1 and 3 from the second PDF
        merger.join("./input2.pdf", PageJoinOptions([1, 3]))

        # Append a third PDF and preserve its bookmarks
        pdf_join = PdfJoinOptions()
        pdf_join.use_bookmarks = True
        merger.join("./input3.pdf", pdf_join)

        # Save the result
        merger.save("./output.pdf")

if __name__ == "__main__":
    merge_pdf_with_options()

input.pdf is a sample file used in this example. Click here to download it.

input2.pdf is a sample file used in this example. Click here to download it.

input3.pdf is a sample file used in this example. Click here to download it.

Binary file (PDF, 418 KB)

Download full output

Where to next

  1. Install the packageInstallation walks through PyPI and offline wheel installation for Windows, Linux, and macOS.
  2. Run your first exampleQuick Start Guide merges, extracts pages, and splits a document in under five minutes.
  3. Explore runnable examplesHow to Run Examples clones the GitHub repository and runs every documented scenario locally or in Docker.
  4. Use it in depth — the Developer Guide covers every API surface with runnable, copy-paste code examples.
  5. Plug it into AI pipelinesAgents and LLM Integration explains the MCP server, AGENTS.md, and how to build AI-driven document assembly pipelines.