We’re happy to announce the release of GroupDocs.Viewer for Python v26.11, available as of November 2026. This release upgrades the underlying GroupDocs.Viewer engine to version 26.10 on the .NET 10 build, and introduces significant improvements to the Python API—including the ability to cancel long-running renders, render to in-memory streams, and open documents directly in the browser using the new groupdocs-viewer CLI command. It also resolves critical stability issues related to memory leaks, process forking, and file handling.

What’s new in this release

  • [Feature] Add CadOptions.enable_layered_rendering to show and hide CAD layers in HTML output without rendering again (VIEWERPYTHON-180)
  • [Feature] Add PdfOptions.fix_thai_marks to fix stranded Thai marks when rendering PDF to HTML (VIEWERPYTHON-181)
  • [Feature] Cancel a running render with CancellationTokenSource and view(options, cancellation_token=...) (VIEWERPYTHON-182)
  • [Feature] Add the groupdocs-viewer command to open a document or a folder in the browser (VIEWERPYTHON-199)
  • [Enhancement] Update the GroupDocs.Viewer engine from 26.8 to 26.10, on its .NET 10 build (VIEWERPYTHON-183)
  • [Enhancement] Raise LicenseError when the licence in GROUPDOCS_LIC_PATH cannot be applied, instead of running in evaluation mode silently (VIEWERPYTHON-184)
  • [Enhancement] Pass stream input and BytesIO output to .NET by pointer instead of base64 JSON (VIEWERPYTHON-185)
  • [Enhancement] Install the modules every GroupDocs Python package shares from the groupdocs-shared-net package (VIEWERPYTHON-186)
  • [Enhancement] Link docstrings to the Python documentation, and give each overload an example that calls it (VIEWERPYTHON-187)
  • [Fix] Components with known CVEs in 26.9.0: .NET runtime 10.0.12, System.Formats.Asn1 8.0.0, System.Security.Cryptography.Pkcs 8.0.0 and libpng 1.6.44 (ICU 59 in the engine’s Slides library remains) (VIEWERPYTHON-165)
  • [Fix] Python: assigning an option that does not exist is silently ignored (VIEWERPYTHON-170)
  • [Fix] A file object passed as input was closed by the call, and emptied when opened for update (VIEWERPYTHON-188)
  • [Fix] Memory grew with every call that passed a stream or a callback: their .NET objects were never released (VIEWERPYTHON-189)
  • [Fix] A process forked after the first Viewer call made the parent process crash with a segmentation fault (VIEWERPYTHON-190)
  • [Fix] Rendering to memory with a Python function failed: “cannot wrap function as CreatePageStream” (VIEWERPYTHON-191)
  • [Fix] Renders running in parallel threads could leave a BytesIO output empty or raise another thread’s exception (VIEWERPYTHON-192)
  • [Fix] On Windows, the package ran on a .NET installed on the machine, and failed beside another GroupDocs Python package (VIEWERPYTHON-193)
  • [Fix] On Linux, the engine’s font cache was written into the working directory (VIEWERPYTHON-194)
  • [Fix] On Python 3.10 and earlier, a SpooledTemporaryFile such as FastAPI’s UploadFile.file could not be passed to Viewer (VIEWERPYTHON-198)

New features

Open documents in the browser

The package installs a groupdocs-viewer command. It starts a small web server on your machine and opens the GroupDocs.Viewer web UI in the browser, with page navigation, zoom, rotation, thumbnails, search, print, PDF download and a dark theme. The server uses the Python standard library only, so it adds no dependency and runs on Python 3.5 to 3.14:

groupdocs-viewer                      # browse the current folder
groupdocs-viewer ~/documents          # browse a folder and its subfolders
groupdocs-viewer report.docx -t png   # open one file, rendered as PNG pages
python -m groupdocs.viewer --version

It takes the options of the .NET tool GroupDocs.Viewer CLI — -p/--port (default 8080, or a free port when it is busy), -b/--bind, --no-open, -l/--license-path, -t/--viewer-type html|png|jpg — and --allow-host, --cache-dir and -v/--verbose. It is for the person at the machine: the address it prints and opens carries a session token, so other users of the machine and other websites cannot use it, and it listens on 127.0.0.1 unless told otherwise. Given a file, it serves that file only. Files cannot be uploaded, and a changed file is rendered again instead of being served from the cache. The UI is the build of GroupDocs.Viewer UI 26.10.0, on Angular 22. To embed the viewer in a FastAPI, Flask or Django application, use the groupdocs-viewer-net-ui package.

Cancel a running render

view(), get_view_info(), get_attachments() and save_attachment() take a cancellation_token, and CancellationTokenSource, CancellationToken and OperationCanceledError are importable from groupdocs.viewer. Cancel from another thread with source.cancel(), or after a number of seconds with cancel_after:

from groupdocs.viewer import CancellationTokenSource, OperationCanceledError, Viewer
from groupdocs.viewer.options import HtmlViewOptions

source = CancellationTokenSource()
source.cancel_after(30)  # seconds; or source.cancel() from another thread
try:
    with Viewer("large.xlsx") as viewer:
        viewer.view(HtmlViewOptions.for_embedded_resources("page_{0}.html"),
                    cancellation_token=source.token)
except OperationCanceledError:
    print("cancelled")

The engine checks the token before rendering starts and, in a render of all pages to HTML, PNG or JPG, between pages. A render to PDF, and a render of an explicit page list, run to the end once rendering has started.

Render to memory with a Python function

Every documented way to render without writing files failed in 26.9: a function passed to PngViewOptions, JpgViewOptions, PdfViewOptions or HtmlViewOptions.for_embedded_resources / for_external_resources raised “cannot wrap function as CreatePageStream”. Functions and factory objects now work, and each BytesIO is filled by the time view() returns:

import io
from groupdocs.viewer import Viewer
from groupdocs.viewer.options import PdfViewOptions, PngViewOptions

pages = {}

def create_page_stream(page_number):
    pages[page_number] = io.BytesIO()
    return pages[page_number]

pdf = io.BytesIO()
with Viewer("document.docx") as viewer:
    viewer.view(PngViewOptions(create_page_stream))
    viewer.view(PdfViewOptions(lambda: pdf))
print({number: len(page.getvalue()) for number, page in pages.items()}, len(pdf.getvalue()))

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 render quietly came out in evaluation mode: two pages, with a notice on each. Now every Viewer call raises LicenseError until a licence is applied. The message names the variable, the source and the engine’s reason:

from groupdocs.viewer import LicenseError, Viewer
from groupdocs.viewer.options import PdfViewOptions

try:
    with Viewer("document.docx") as viewer:
        viewer.view(PdfViewOptions("output.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.

CAD layers in HTML output

With CadOptions.enable_layered_rendering set, a CAD drawing rendered to HTML groups each layer’s objects under an element whose id is the layer name, so a page can show and hide layers without rendering again:

from groupdocs.viewer import Viewer
from groupdocs.viewer.options import HtmlViewOptions

options = HtmlViewOptions.for_embedded_resources("page_{0}.html")
options.cad_options.enable_layered_rendering = True
with Viewer("drawing.dwg") as viewer:
    viewer.view(options)

Thai text in PDF rendered to HTML

PdfOptions.fix_thai_marks fixes Thai marks that Safari and iOS browsers display stranded when a PDF is rendered to HTML with embedded resources. It can slow rendering down considerably, so it is off by default:

from groupdocs.viewer import Viewer
from groupdocs.viewer.options import HtmlViewOptions

options = HtmlViewOptions.for_embedded_resources("page_{0}.html")
options.pdf_options.fix_thai_marks = True
with Viewer("thai.pdf") as viewer:
    viewer.view(options)

Code example

The following example renders the first three pages of a PDF document to HTML in memory, with Thai mark correction, and writes no files:

import io
from groupdocs.viewer import Viewer
from groupdocs.viewer.options import HtmlViewOptions

pages = {}

def create_page_stream(page_number):
    pages[page_number] = io.BytesIO()
    return pages[page_number]

with Viewer("document.pdf") as viewer:
    options = HtmlViewOptions.for_embedded_resources(create_page_stream)
    options.pdf_options.fix_thai_marks = True
    viewer.view(options, page_numbers=[1, 2, 3])

print({number: len(page.getvalue()) for number, page in pages.items()})

How to get the update

PyPI

Upgrade to the latest groupdocs-viewer-net package via PyPI: GroupDocs.Viewer for Python v26.11

pip install groupdocs-viewer-net==26.11.0

Direct download

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

Resources