We’re happy to announce the release of GroupDocs.Merger for Python v26.12, available as of December 2026. This release upgrades the GroupDocs.Merger engine from 26.4 to 26.11 and migrates it to the engine’s .NET 10 build, bringing 20 features, enhancements and fixes since v26.6 — including a new CLI command, row-wise spreadsheet joining, fine-grained control over external resource loading, and memory-safe handling of streams and callbacks.

What’s new in this release

  • [Feature] Add the groupdocs-merger command to merge, split, extract and remove pages from the command line (MERGERPYTHON-34)
  • [Feature] Append the rows of several spreadsheets to one worksheet with SpreadsheetJoinOptions (MERGERPYTHON-49)
  • [Feature] Choose which external resources a document loads with skip_external_resources, whitelisted_resources and external_resource_handler on LoadOptions (MERGERPYTHON-50)
  • [Enhancement] Update the GroupDocs.Merger engine from 26.4 to 26.11, on its .NET 10 build (MERGERPYTHON-51)
  • [Enhancement] Raise LicenseError when the licence in GROUPDOCS_LIC_PATH cannot be applied, instead of running in evaluation mode silently (MERGERPYTHON-52)
  • [Enhancement] Pass stream input and BytesIO output to .NET by pointer instead of base64 JSON (MERGERPYTHON-53)
  • [Enhancement] Install the modules every GroupDocs Python package shares from the groupdocs-shared-net package (MERGERPYTHON-54)
  • [Fix] Components with known CVEs in 26.6.0: .NET runtime 10.0.0 and libpng 1.6.44 (MERGERPYTHON-36)
  • [Fix] Assigning an option that does not exist was silently ignored (MERGERPYTHON-56)
  • [Fix] A file object passed as input was closed by the call, and emptied when opened for update (MERGERPYTHON-57)
  • [Fix] Memory grew with every call that passed a stream or a callback: their .NET objects were never released (MERGERPYTHON-58)
  • [Fix] A process forked after the first Merger call made the parent process crash with a segmentation fault (MERGERPYTHON-59)
  • [Fix] Previews and split parts written to a BytesIO stayed empty (MERGERPYTHON-60)
  • [Fix] A relative output path did not resolve against the working directory (MERGERPYTHON-61)
  • [Fix] Calls running in parallel threads could leave a BytesIO output empty or raise another thread’s exception (MERGERPYTHON-62)
  • [Fix] On Windows, the package ran on a .NET installed on the machine instead of the one in its wheel (MERGERPYTHON-63)
  • [Fix] On Python 3.10 and earlier, a SpooledTemporaryFile such as FastAPI’s UploadFile.file could not be passed to Merger (MERGERPYTHON-64)
  • [Fix] An exception raised in a preview or split release function was lost (MERGERPYTHON-65)
  • [Fix] pip installed the Linux and macOS wheels on systems too old to run them (MERGERPYTHON-66)
  • [Fix] On Linux, the engine’s font cache was written into the working directory (MERGERPYTHON-67)

Public API changes

Nothing is removed or renamed.

New types

  • groupdocs.merger.domain.options: SpreadsheetJoinOptions joins spreadsheets by worksheets or by rows (mode, skip_rows, sheet_matching), with the enums SpreadsheetJoinMode and SpreadsheetSheetMatching.
  • groupdocs.merger.domain.options: ExternalResourceLoadingArgs is what an external resource handler receives (uri, skipped, data), IExternalResourceHandler is the handler interface (on_loading), and IResourceLoadingOptions is the interface of the three resource properties of LoadOptions.
  • groupdocs.merger.exceptions: MissingDependencyException is raised when an operation needs a component that is missing on the machine, and AutoTaggingNotSupportedException when PDF auto-tagging cannot be applied to a document. Both derive from GroupDocsMergerException.
  • groupdocs.merger.exceptions: LicenseError is raised by every Merger call while a licence that could not be applied is pending; LicenseWarning is warned instead with GROUPDOCS_LIC_STRICT=0.
  • groupdocs.merger: GroupDocsMergerException, the class of every engine error that has no more specific Python exception, is importable from the package root as well as from groupdocs.merger.exceptions.
  • groupdocs.merger: CancellationTokenSource, CancellationToken and OperationCanceledError, as in the other GroupDocs Python packages; no Merger operation takes a cancellation token in this release.

New members on existing classes

Class Member Description
LoadOptions skip_external_resources True by default: external resources are not loaded
LoadOptions whitelisted_resources Absolute URI prefixes to load while skip_external_resources is True
LoadOptions external_resource_handler A function or an object with on_loading(args) that decides for each external resource

New features

Merge and split from the command line

The package installs a groupdocs-merger command, which python -m groupdocs.merger also runs:

groupdocs-merger merge report.pdf appendix.pdf -o combined.pdf
groupdocs-merger merge sales-january.xlsx sales-february.xlsx -o sales.xlsx --sheet-mode rows --skip-rows 1
groupdocs-merger split handbook.pdf -o parts --at 3,6     # pages 1-2, 3-5, 6 to the end
groupdocs-merger extract contract.pdf -o pages.pdf --pages 2-4,7
groupdocs-merger remove scan.pdf -o odd-pages.pdf --pages 1- --even
python -m groupdocs.merger --version

merge joins the documents in order and keeps the first one’s format; --image-layout, --word-mode and --sheet-mode choose how images, Word documents and spreadsheets are joined. split writes one file per page of --pages, or starts a new file at each page of --at, and splits a text file by lines. extract keeps the listed pages and remove drops them. Pages count from 1, 5- runs to the last page, and --odd / --even filter the list. --password opens a protected document, and --license applies a licence file or URL (GROUPDOCS_LIC_PATH also works). A mistake in the command line exits with code 2 and writes nothing, and a document the engine cannot process exits with code 1.

Spreadsheet rows into one worksheet

SpreadsheetJoinOptions with SpreadsheetJoinMode.ROWS appends the rows of each joined workbook below the last row with data, and skip_rows leaves out each joined file’s header rows:

from groupdocs.merger import Merger
from groupdocs.merger.domain.options import SpreadsheetJoinMode, SpreadsheetJoinOptions

options = SpreadsheetJoinOptions()
options.mode = SpreadsheetJoinMode.ROWS   # append rows instead of adding worksheets
options.skip_rows = 1                     # leave out each joined file's header row

with Merger("sales-january.xlsx") as merger:
    merger.join("sales-february.xlsx", options)
    merger.join("sales-march.xlsx", options)
    merger.save("sales-q1.xlsx")

sheet_matching pairs the worksheets by position (SpreadsheetSheetMatching.BY_INDEX, the default) or takes the first worksheet of each file only (SpreadsheetSheetMatching.FIRST_SHEET_ONLY). The default mode, SpreadsheetJoinMode.WORKSHEETS, adds the worksheets of each file, as joining spreadsheets always did.

Control over the external resources a document loads

Engine 26.10 stopped loading the external resources a document links to (images, stylesheets and other files on the web, the network or the local disk) unless you allow them. Content a document carries, such as the pictures inside a DOCX, still loads. Three LoadOptions properties decide:

from groupdocs.merger import Merger
from groupdocs.merger.domain import FileType
from groupdocs.merger.domain.options import LoadOptions

def allow_photos(args):
    # args.uri is the reference; args.skipped holds the decision made so far
    if args.uri.startswith("https://images.example.com/") and args.uri.lower().endswith(".jpg"):
        args.skipped = False

options = LoadOptions(FileType.HTML)
options.whitelisted_resources = ["https://cdn.example.com/styles/"]  # load what is under this prefix
options.external_resource_handler = allow_photos                     # then decide per resource

with Merger("page.html", options) as merger:
    merger.join("page2.html")
    merger.save("pages.html")

whitelisted_resources lists the absolute URI prefixes to load. external_resource_handler takes a function or an object with an on_loading(args) method; it sees every external resource after the defaults and the whitelist have decided, and can load it (args.skipped = False), skip it (True), or supply its content as bytes in args.data. skip_external_resources = False loads every resource, as 26.6 did; use it only for documents you trust.

Previews and split parts in memory

A preview or split function can return an io.BytesIO, which holds the page or the part when the call returns; in 26.6 it stayed empty. A release function written as release(number, stream) also gets the stream its create function returned, already written:

import io
from groupdocs.merger import Merger
from groupdocs.merger.domain.options import PreviewMode, PreviewOptions, SplitMode, SplitOptions

parts, pages = {}, {}

def create_part(number):
    parts[number] = io.BytesIO()
    return parts[number]

def create_page(page_number):
    return io.BytesIO()

def release_page(page_number, stream):
    pages[page_number] = stream.getvalue()   # the PNG of this page

with Merger("document.pdf") as merger:
    merger.split(SplitOptions(create_part, [1, 2], SplitMode.PAGES))
    merger.generate_preview(PreviewOptions(create_page, release_page, PreviewMode.PNG, [1, 2]))

print({number: len(part.getvalue()) for number, part in parts.items()})
print({number: len(png) for number, png in pages.items()})

A release function written as release(number) works as before. Documents also cross to .NET faster: one passed as a BytesIO or another readable object is copied into .NET once, and a result saved to a BytesIO is copied back once, where both used to travel as base64 text inside JSON.

LicenseError instead of silent evaluation mode

A licence that failed to apply (an expired subscription, a licence for another product, a missing file) used to be ignored, and every result quietly came out in evaluation mode: the first three pages only, with the notice “Created with evaluation version of GroupDocs.Merger”. Now every Merger call raises LicenseError until a licence is applied. The message names the variable, the source and the reason:

from groupdocs.merger import LicenseError, Merger

try:
    with Merger("report.pdf") as merger:
        merger.join("appendix.pdf")
        merger.save("combined.pdf")
except LicenseError as error:
    print(error)

GROUPDOCS_LIC_STRICT=0 turns the failure into one LicenseWarning and evaluation mode. License().set_license(...) applied in code ends the refusal.

Engine 26.11 on its .NET 10 build

The package now wraps GroupDocs.Merger for .NET 26.11 through its .NET 10 builds: GroupDocs.Merger.Net100 on Linux and macOS, and GroupDocs.Merger.Net100.Windows on Windows. It brings the engine’s changes of 26.7 to 26.11, among them a page orientation change applied to every page when no pages are given, the preview width and height honoured in every format, PDF auto-tagging that keeps the document’s format and title, and Word page operations that return the right pages when a table spans several pages. A format whose component is missing on the machine raises MissingDependencyException.

On Linux and macOS, presentations no longer need libgdiplus: 26.6.0 could not join, split, preview or protect a PowerPoint file without it, and 26.12.0 needs it for OneNote documents only. On Linux, presentations need fontconfig (libfontconfig1) instead. The embedded .NET runtime moves from 10.0.0 to 10.0.15.

One package for the shared modules

groupdocs.pydrawing (Color, Point, Size, Rectangle) and groupdocs.pycore used to be copied into every product wheel. With several GroupDocs packages in one environment the last install won, and uninstalling one product removed them for the others. They now come from groupdocs-shared-net 26.11.0, which pip installs with groupdocs-merger-net. from groupdocs.merger import Color is unchanged.

Code example

from groupdocs.merger import Merger
from groupdocs.merger.domain.options import SpreadsheetJoinMode, SpreadsheetJoinOptions

options = SpreadsheetJoinOptions()
options.mode = SpreadsheetJoinMode.ROWS
options.skip_rows = 1

with Merger("sales-jan.xlsx") as merger:
    merger.join("sales-feb.xlsx", options)
    merger.save("sales-q1.xlsx")

How to get the update

PyPI

Install or upgrade via PyPI:

pip install groupdocs-merger-net==26.12.0

Package: groupdocs-merger-net 26.12.0 on PyPI

Direct download

Download the wheel for Windows, Linux or macOS from GroupDocs.Merger for Python via .NET downloads. An offline install also needs groupdocs-shared-net from PyPI.

Resources