Installing the groupdocs-merger-net package also puts a groupdocs-merger command on your PATH. It runs the Python API for the jobs where a script is more than you need: shell pipelines, Make rules, CI steps and one-off tasks. The command arrived with version 26.12.
Prerequisites
The command ships inside the package, so nothing else needs installing. Install groupdocs-merger-net as described in Installation, then check that the command is available:
groupdocs-merger --version
groupdocs-merger 26.12.0
Note
If the shell does not find groupdocs-merger, the package’s script folder is not on your PATH. python -m groupdocs.merger runs the same command, for example python -m groupdocs.merger --version.
Sample files
The examples on this page use these sample files. Download them into one folder and run the commands from there:
The command has four subcommands. Run groupdocs-merger --help for the full list of options, or groupdocs-merger <command> --help for one subcommand. Page lists count from 1: 1,3,5-7 lists pages, and 5- runs to the last page.
merge
Join two or more documents in the order given. The result keeps the format of the first document, so the output file takes its extension.
Start each document on a new page (the default), continue on the same page, or drop the section breaks.
--sheet-mode worksheets|rows
Spreadsheets
Add the worksheets of each workbook (the default), or append its rows below the existing data.
--skip-rows N
Spreadsheets, with --sheet-mode rows
Skip the first N rows of each joined workbook, such as its header row.
--password PASSWORD
Any format
The password of the first document, if it is protected.
# Append February's orders below January's, without February's header rowgroupdocs-merger merge ledger-2026-01.xlsx ledger-2026-02.xlsx -o ledger-2026.xlsx --sheet-mode rows --skip-rows 1# Place two pictures side by sidegroupdocs-merger merge photo-card-1.png photo-card-2.png -o photo-cards.png --image-layout horizontal
ledger-2026.xlsx has one worksheet: the header row and the 24 orders of both months. photo-cards.png is 1200 × 405 pixels, the two pictures side by side.
split
Split a document into several files in a folder, which is created if it is missing. --pages writes one file per listed page, and --at starts a new file at each listed page.
# Three files: pages 1-2, pages 3-5, and page 6 to the endgroupdocs-merger split board-pack.pdf -o parts --at 3,6
# One file per page, named page-1.pdf to page-6.pdfgroupdocs-merger split board-pack.pdf -o pages --pages 1- --name page-{0}.pdf
The first command writes board-pack_0.pdf (pages 1 and 2), board-pack_1.pdf (pages 3 to 5) and board-pack_2.pdf (page 6) into the parts folder. The command prints the path of each file it wrote, and the number of files to standard error.
Option
Effect
--pages LIST
One file per listed page.
--at LIST
A new file starts at each listed page: 3,6 gives pages 1-2, 3-5 and 6 to the end.
--name PATTERN
The names of the files. {0} stands for the page number with --pages, and for the part’s index, counted from 0, with --at. The default is the input’s name followed by _{0} and its extension.
--odd, --even
Only the odd or the even pages of the list.
--password PASSWORD
The password of the document, if it is protected.
A text file is split by lines: the lists then give line numbers, and {0} is the part’s index, counted from 0.
The command also reads the GROUPDOCS_LIC_PATH environment variable, as the Python API does, so with the variable set you can omit --license. See Licensing and Evaluation for both. Without a license, the command runs in evaluation mode: a result holds at most three pages and carries an evaluation notice. A license that cannot be read or applied stops the command with exit code 1 and a message that says why.
Exit codes
Code
Meaning
0
Success.
2
A mistake in the command line, such as a missing input file, a page past the end of the document, or an output extension that differs from the input’s. Nothing is written.
1
The document or the license could not be processed. The reason is printed to standard error.
These codes make the command easy to branch on in shell scripts and CI pipelines.
When to use the Python API instead
The command joins and splits files on disk. For anything beyond that, use the Python API: streams and in-memory documents, page previews, document information, adding, changing and removing passwords, moving, swapping and rotating pages, and importing documents as OLE objects or attachments. See the Developer Guide for runnable examples of each.
Next steps
Hello, World!: merge two documents with the Python API.
Quick Start Guide: three short examples that merge, extract pages and split.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Ask AI
Ask anything about this page — the answer is based on its content.
Searching the docs and writing an answer…
Something went wrong while getting an answer. Please try again in a moment.