Skip to main content

banner

PyPI PyPI - Python Version

Product Page | Docs | Demos | API Reference | Blog | Free Support | Temporary License

GroupDocs.Viewer for Python via .NET is a document rendering API that displays 190+ file formats — DOCX, PDF, XLSX, PPTX, CAD drawings, email messages, archives, and more — as HTML, PNG, JPG, or PDF. It preserves layout and formatting while offering per-format rendering options, renders to files or to memory, and its groupdocs-viewer command opens documents in the browser.

Get Started

pip install groupdocs-viewer-net
from groupdocs.viewer import Viewer
from groupdocs.viewer.options import HtmlViewOptions

with Viewer("document.docx") as viewer:
    options = HtmlViewOptions.for_embedded_resources("page_{0}.html")
    viewer.view(options)

How It Works

The package is a self-contained Python wheel (about 175 MB on Windows, 185-190 MB on Linux and macOS) that bundles the .NET 10 runtime and everything else needed to render documents. No external software installation is required — just pip install and start viewing; pip also installs groupdocs-shared-net, the small package of modules every GroupDocs Python package shares. For an offline install, download both wheels and install them together: pip install --no-index --find-links <folder> groupdocs-viewer-net. The wheel works across Python 3.5 – 3.14 on Windows, Linux, and macOS (Intel + Apple Silicon).

Features

  • Wide Format Support: 190+ file formats across Microsoft Office, PDF, images, CAD, email, and archives.
  • Flexible Output: Render to HTML (embedded or external resources), PNG, JPG, or PDF.
  • Page Control: Render whole documents, selected pages, page ranges, or reordered pages.
  • Custom Streams: Route each page or resource to a Python-provided stream factory — no disk writes required.
  • Browser Viewer: groupdocs-viewer report.docx opens a document, or a whole folder, in the GroupDocs.Viewer web UI on your machine — no web framework needed.
  • Cross-Platform: Windows x64, Linux x64, macOS x64/ARM64.

Common Tasks

  • Render DOCX, PDF, XLSX, or PPTX to HTML for an in-browser document viewer
  • Open a document or a folder of documents in the browser from the command line
  • Generate per-page PNG or JPG thumbnails and previews
  • Produce a print-ready PDF from any supported format
  • View CAD drawings (DWG, DXF) without AutoCAD
  • Display email messages (MSG, EML) together with their attachments
  • Render specific pages, page ranges, or reordered pages
  • Feed rendered HTML or page images into an AI / RAG document-preview pipeline

Supported File Formats

For a complete list, see supported formats.

  • Microsoft Office (Word, Excel, PowerPoint, Visio, Project, Outlook)
  • PDF (Standard PDFs, PDF/A)
  • OpenDocument (ODT, ODS, ODP)
  • Images (JPEG, PNG, TIFF, BMP, SVG, WebP, DICOM)
  • Email (EML, MSG, PST, OST)
  • eBook (EPUB, MOBI, AZW3)
  • Archives (ZIP, TAR, RAR, 7Z)
  • AutoCAD (DWG, DXF, DGN, IFC)
  • Web (HTML, MHTML, CHM, XML)

Platform & Format Support

Format family Windows Linux / macOS
Photoshop (PSD, PSB) Yes No
Adobe Illustrator (AI) Yes No
OneNote (ONE) Yes No
All other formats (Office, PDF, Visio, Project, CAD, images, email, archives, eBooks, web, …) Yes Yes

Windows wheels run the Windows build of the engine (GroupDocs.Viewer.Net100.Windows); Linux and macOS wheels run its cross-platform build (GroupDocs.Viewer.Net100), which renders every format except Photoshop (PSD, PSB), Adobe Illustrator (AI) and OneNote — render those on Windows. Visio and Microsoft Project (MPP, MPT, MPX) work on every platform; on Linux, Project files need the Microsoft core fonts (ttf-mscorefonts-installer).

Examples

Render DOCX to HTML (embedded resources)

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

with Viewer("./document.docx") as viewer:
    viewer.view(HtmlViewOptions.for_embedded_resources("./out/page_{0}.html"))

Render selected pages to PNG

from groupdocs.viewer import Viewer
from groupdocs.viewer.options import PngViewOptions

with Viewer("./document.pdf") as viewer:
    viewer.view(PngViewOptions("./out/page_{0}.png"), page_numbers=[1, 3, 5])

Render with Advanced Options

from groupdocs.viewer import Viewer
from groupdocs.viewer.options import HtmlViewOptions, LoadOptions, Watermark

load_options = LoadOptions()
load_options.password = "12345"

with Viewer("./protected.docx", load_options) as viewer:
    options = HtmlViewOptions.for_embedded_resources("./out/page_{0}.html")
    options.watermark = Watermark("CONFIDENTIAL")
    options.render_responsive = True
    viewer.view(options)

Get View Info

from groupdocs.viewer import Viewer
from groupdocs.viewer.options import ViewInfoOptions

with Viewer("./document.pdf") as viewer:
    info = viewer.get_view_info(ViewInfoOptions.for_html_view())
    print("Pages:", len(info.pages))

Render from Stream / BytesIO

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

with open("document.docx", "rb") as stream:
    with Viewer(stream) as viewer:
        viewer.view(HtmlViewOptions.for_embedded_resources("./out/page_{0}.html"))

with open("document.docx", "rb") as f:
    buf = io.BytesIO(f.read())   # e.g. bytes downloaded over HTTP
with Viewer(buf) as viewer:
    viewer.view(HtmlViewOptions.for_embedded_resources("./out/page_{0}.html"))

Render to Custom Streams (no disk writes)

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

pages = {}  # page number -> io.BytesIO

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

with Viewer("./document.docx") as viewer:
    viewer.view(PngViewOptions(create_page))
# pages now holds {1: <BytesIO>, 2: <BytesIO>, ...}

Cancel a Long Render

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:
    pass

The engine stops between pages of an HTML, PNG or JPG render. A PDF render, and a render of an explicit page list, run to the end once rendering has started. To stop those, render in a worker process started with multiprocessing.get_context("spawn"), and terminate it on timeout.

View 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 UI in the browser: page navigation, zoom, rotation, thumbnails, search, print, PDF download and a dark theme. It needs nothing beyond the package. The address it prints and opens carries a session token (http://127.0.0.1:8080/?token=...), so other users of the machine and other websites cannot use the server; after a restart, open the new address.

groupdocs-viewer                          # browse the current folder
groupdocs-viewer ~/documents              # browse a folder and its subfolders
groupdocs-viewer report.docx              # open one file; nothing else is served
groupdocs-viewer drawing.dwg -t png -p 9000 --no-open
python -m groupdocs.viewer contracts -l GroupDocs.Viewer.lic
Option Default
path current folder A file or a folder. Given a file, only that file is served.
-p, --port 8080 When 8080 is busy, a free port is used. 0 asks for any free port.
-b, --bind 127.0.0.1 Only this machine can connect. Any other address lets other machines connect, and only the session token keeps them out.
--allow-host Another name the browser may use for the server, such as a DNS name of this machine (repeatable).
--no-open Do not open the browser.
-l, --license-path GROUPDOCS_LIC_PATH Licence file or URL. A licence that cannot be applied stops the command at startup.
-t, --viewer-type html Render pages as html, png or jpg.
--cache-dir per-user cache folder Rendered pages are kept here and rendered again when a file changes.
-v, --verbose Log every request, and the full error of a failed one.

Files cannot be uploaded. Hidden files (and on Windows, files and folders with the hidden or system attribute) and links that lead out of the folder are not served. Press Ctrl+C to stop. To put the viewer inside your own FastAPI, Flask or Django application, with cloud storage, a shared cache or authentication, use groupdocs-viewer-net-ui.

AI Agent & LLM Friendly

This package is designed for seamless integration with AI agents, LLMs, and automated code generation tools.

  • AGENTS.md in the package -- AI coding assistants (Claude Code, Cursor, GitHub Copilot) auto-discover the API surface, usage patterns, and troubleshooting tips from the installed package
  • MCP server -- connect your AI tool to GroupDocs documentation for on-demand API lookups:
    { "mcpServers": { "groupdocs-docs": { "url": "https://docs.groupdocs.com/mcp" } } }
    
  • GroupDocs.Viewer MCP server -- let an agent see document pages: it renders any page as a PNG image on your machine, with nothing uploaded: docs.groupdocs.com/viewer/mcp
  • Machine-readable docs -- full documentation available as plain text for RAG and LLM context:
    • Single file: https://docs.groupdocs.com/viewer/python-net/llms-full.txt
    • Per page: append .md to any docs URL

Evaluation Mode

The API works without a license in evaluation mode with the following limitations:

  • An evaluation notice is added to every rendered page.
  • Only the first two pages of a document are rendered, and get_view_info reports at most two.

To remove these limitations, apply a license or request a temporary license:

from groupdocs.viewer import License
License().set_license("path/to/license.lic")

Or set the environment variable, which is applied at the first Viewer call:

export GROUPDOCS_LIC_PATH="path/to/license.lic"

If that licence cannot be applied (an expired subscription, a licence for another product, a missing file), every Viewer call raises LicenseError with the reason until a licence is applied. Set GROUPDOCS_LIC_STRICT=0 to run in evaluation mode with a LicenseWarning instead.

Troubleshooting

Issue Platform Fix
Failed to detect file type for PSD, PSB, AI or ONE Linux/macOS These formats are Windows-only — render them on Windows
Cannot find fallback font 'Generic Sans Serif' rendering MPP/MPT/MPX Linux Install the Microsoft core fonts: apt-get install ttf-mscorefonts-installer && fc-cache -f (Debian: enable contrib). Liberation fonts do not satisfy this lookup
Garbled text or missing fonts in rendered HTML/PDF Linux apt-get install ttf-mscorefonts-installer fontconfig && fc-cache -f
DllNotFoundException: libgdiplus or The type initializer for 'Gdip' threw an exception Linux/macOS Not expected: since 26.9 no libgdiplus is needed. Install it (apt-get install libgdiplus / brew install mono-libgdiplus) and report the document to support
The process exits with code 134 and Couldn't find a valid ICU package, with no Python exception Linux Install ICU (apt-get install libicu-dev). Do NOT set DOTNET_SYSTEM_GLOBALIZATION_INVARIANT instead
Page images (PNG, JPG) of a spreadsheet lose the spaces between words and clip digits at cell edges Linux A known issue of engine 26.10: render spreadsheets to PDF or HTML on Linux
A workbook rendered twice with the same Viewer has more pages the second time All A known engine issue: create a new Viewer for each render
The process dies while rendering a presentation whose fonts are not installed Linux Happens when Debian's fonts-noto-extra is installed: set default_font_name on the view options to an installed font, or remove fonts-noto-extra
DllNotFoundException: libSkiaSharp after upgrading macOS An older system copy is shadowing the bundled one: sudo mv /usr/local/lib/libSkiaSharp.dylib /usr/local/lib/libSkiaSharp.dylib.bak
RuntimeError: The .NET runtime cannot be used in a process forked after it started (up to 26.9.0: the parent process died with a segmentation fault) Linux/macOS A worker was forked after the parent's first GroupDocs call: multiprocessing with the fork start method, gunicorn --preload, Celery prefork. Use multiprocessing.get_context("spawn"), start the workers before the first call, or drop --preload. uvicorn --workers is safe
is not a supported wheel on this platform, No matching distribution found for groupdocs-viewer-net, or pip installs a version older than 26.9 Linux/macOS The OS is older than the wheel needs (glibc 2.27, macOS 12), or pip is older than 20.3: python -m pip install --upgrade pip. Versions up to 26.5 were tagged for older systems, so an unpinned install falls back to them — and they fail at first use there. On an Intel Mac, a Python built against an old SDK reports macOS 10.16 — use pip 24.1+ or SYSTEM_VERSION_COMPAT=0 pip install groupdocs-viewer-net

libgdiplus is not required. The Linux and macOS wheels render through SkiaSharp and Aspose.Drawing and never call libgdiplus: every format family renders the same with and without it in a Linux container. You can drop libgdiplus / mono-libgdiplus from your images and provisioning scripts.

System Requirements

  • Python 3.5 - 3.14, pip 20.3 or newer
  • Windows x64, Linux x64, macOS x64/ARM64 — 64-bit Python only; there is no 32-bit Windows wheel
  • Linux: glibc 2.27 or newer (e.g. Ubuntu 18.04+, Debian 10+, RHEL 8+), plus fonts and ICU (apt-get install libicu-dev fontconfig ttf-mscorefonts-installer; on Debian enable contrib first). No libgdiplus.
  • macOS 12 or newer, Intel or Apple Silicon.

Upgrading from 26.9

  • A misspelled option raises. Assigning an attribute that a class does not have raises AttributeError with a "Did you mean" hint. 26.9 stored it on the Python object and the engine never saw it: options.cad_options.pc_3_file = "plot.pc3" did nothing; the property is pc3_file.
  • A licence that cannot be applied raises LicenseError at the first Viewer call, where 26.9 rendered in evaluation mode without a word. GROUPDOCS_LIC_STRICT=0 brings evaluation mode back, with a LicenseWarning.
  • pip also installs groupdocs-shared-net, the package of groupdocs.pydrawing and groupdocs.pycore that every GroupDocs Python package shares. An offline install needs both wheels in one folder. from groupdocs.viewer import Color is unchanged.
  • A file object passed to Viewer stays open after the call; 26.9 closed it, and emptied one opened with "r+b".
  • view() takes .NET's argument order when it gets a cancellation token: options, token, page numbers, or keywords (viewer.view(options, cancellation_token=token, page_numbers=[1, 2])).
  • The engine is GroupDocs.Viewer for .NET 26.10 on its .NET 10 build (GroupDocs.Viewer.Net100.Windows on Windows, GroupDocs.Viewer.Net100 on Linux and macOS), with the .NET runtime 10.0.15.

More Resources

Also available for other platforms: .NET | Java | Node.js


Product Page | Docs | Demos | API Reference | Blog | Free Support | Temporary License

Metadata

Release files for groupdocs-viewer-net 26.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for groupdocs-viewer-net 26.11.0
File Actions
groupdocs_viewer_net-26.11.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for groupdocs_viewer_net-26.11.0-py3-none-win_amd64.whl
groupdocs_viewer_net-26.11.0-py3-none-manylinux_2_27_x86_64.whl Python 3 none Linux glibc 2.27+ x86-64 Details for groupdocs_viewer_net-26.11.0-py3-none-manylinux_2_27_x86_64.whl
groupdocs_viewer_net-26.11.0-py3-none-macosx_12_0_x86_64.whl Python 3 none macOS 12.0+ x86-64 Details for groupdocs_viewer_net-26.11.0-py3-none-macosx_12_0_x86_64.whl
groupdocs_viewer_net-26.11.0-py3-none-macosx_12_0_arm64.whl Python 3 none macOS 12.0+ ARM64 Details for groupdocs_viewer_net-26.11.0-py3-none-macosx_12_0_arm64.whl

Total release size: 734.5 MB

Release files / groupdocs_viewer_net-26.11.0-py3-none-win_amd64.whl

Download URL groupdocs_viewer_net-26.11.0-py3-none-win_amd64.whl
Size 172.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
53c4123b7a66b6c0b46a5aa48e236f97cee37e752b9fd48a94011f114f792f55
BLAKE2b-256 checksum
How to use checksums
922069aac2d2e7d15a5dba7c67959e72b82a161180d147116465732ed616d396
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / groupdocs_viewer_net-26.11.0-py3-none-manylinux_2_27_x86_64.whl

Download URL groupdocs_viewer_net-26.11.0-py3-none-manylinux_2_27_x86_64.whl
Size 186.8 MB
Tags Linux glibc 2.27+ x86-64 Python 3
SHA-256 checksum
How to use checksums
a2b1d8919f9a85632d6af54541815d26bacee7b7b39fadcb0a9539717aabc2d0
BLAKE2b-256 checksum
How to use checksums
492003ff25e699e8224ab39a9ac465bff6117229e793b859005e2945a684e65e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / groupdocs_viewer_net-26.11.0-py3-none-macosx_12_0_x86_64.whl

Download URL groupdocs_viewer_net-26.11.0-py3-none-macosx_12_0_x86_64.whl
Size 189.0 MB
Tags Python 3 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
7bebb1312724b518160c5768dd8a757dc09a03cad090ebe5c2562d09b92de68a
BLAKE2b-256 checksum
How to use checksums
c7c544a0d142e5a087f0574f3b17f13b111b385ed0fcad1f6cff6e4399ca9c8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / groupdocs_viewer_net-26.11.0-py3-none-macosx_12_0_arm64.whl

Download URL groupdocs_viewer_net-26.11.0-py3-none-macosx_12_0_arm64.whl
Size 186.6 MB
Tags Python 3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
db90a809142e87d70668bfe26ef1c7dfac17913b6638db46ccad0b0ee449ef01
BLAKE2b-256 checksum
How to use checksums
b39cef4ab30f8794b712fed8d5d087eea0e19ee2b7d3af844c1c35d4c28799e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Security for groupdocs-viewer-net 26.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page