Metadata-Version: 2.4
Name: groupdocs-viewer-net
Version: 26.9.0
Summary: GroupDocs.Viewer for Python via .NET - Render 190+ file formats to HTML, PNG, JPG, or PDF
Author-email: GroupDocs <support@groupdocs.com>
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://products.groupdocs.com/viewer/python-net/
Project-URL: Documentation, https://docs.groupdocs.com/viewer/python-net/
Keywords: viewer,render,view,document,pdf,docx,xlsx,pptx,html,png,image,groupdocs,dotnet
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Requires-Python: <3.15,>=3.5
Description-Content-Type: text/markdown

[![banner](https://raw.githubusercontent.com/groupdocs/groupdocs.github.io/master/img/banners/groupdocs-viewer-python-net-banner.png)](https://docs.groupdocs.com/viewer/python-net/)

[![PyPI](https://img.shields.io/pypi/v/groupdocs-viewer-net)](https://pypi.org/project/groupdocs-viewer-net/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/groupdocs-viewer-net)](https://pypi.org/project/groupdocs-viewer-net/)

[Product Page](https://products.groupdocs.com/viewer/python-net/) | [Docs](https://docs.groupdocs.com/viewer/python-net/) | [Demos](https://products.groupdocs.app/viewer/family) | [API Reference](https://reference.groupdocs.com/viewer/) | [Blog](https://blog.groupdocs.com/category/viewer/) | [Free Support](https://forum.groupdocs.com/c/viewer) | [Temporary License](https://purchase.groupdocs.com/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.

## Get Started

```bash
pip install groupdocs-viewer-net
```

```python
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 (~160 MB) that includes everything needed to render documents. No external software installation is required — just `pip install` and start viewing. 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.
- **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
- 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](https://docs.groupdocs.com/viewer/python-net/supported-document-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; Linux and macOS wheels run its cross-platform build (`GroupDocs.Viewer.Net60`), which renders every format **except** Photoshop (PSD, PSB), Adobe Illustrator (AI) and OneNote — render those on Windows. Visio and, since 26.9, Microsoft Project (MPP, MPT, MPX) work on every platform.

## Examples

### Render DOCX to HTML (embedded resources)

```python
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

```python
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

```python
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

```python
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(f"Pages: {len(info.pages)}")
```

### Render from Stream / BytesIO

```python
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"))

buf = io.BytesIO(downloaded_bytes)
with Viewer(buf) as viewer:
    viewer.view(HtmlViewOptions.for_embedded_resources("./out/page_{0}.html"))
```

### Render to Custom Streams (no disk writes)

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

pages: dict[int, 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>, ...}
```

## 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:
  ```json
  { "mcpServers": { "groupdocs-docs": { "url": "https://docs.groupdocs.com/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:
- A watermark is added to rendered output.
- Only the first few pages are rendered.

To remove these limitations, apply a license or request a [temporary license](https://purchase.groupdocs.com/temporary-license):

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

Or set the environment variable (auto-applied at import):
```bash
export GROUPDOCS_LIC_PATH="path/to/license.lic"
```

## 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 |
| `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT` errors | Linux | Do NOT set this variable. ICU must be available. |
| `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` |

## 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.

## More Resources

- [Documentation](https://docs.groupdocs.com/viewer/python-net/)
- [Code Examples](https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Python-via-.NET)
- [Free Support Forum](https://forum.groupdocs.com/c/viewer)
- [Temporary License](https://purchase.groupdocs.com/temporary-license)

Also available for other platforms:
[.NET](https://products.groupdocs.com/viewer/net/) | [Java](https://products.groupdocs.com/viewer/java/) | [Node.js](https://products.groupdocs.com/viewer/nodejs-java/)

---

[Product Page](https://products.groupdocs.com/viewer/python-net/) | [Docs](https://docs.groupdocs.com/viewer/python-net/) | [Demos](https://products.groupdocs.app/viewer/family) | [API Reference](https://reference.groupdocs.com/viewer/) | [Blog](https://blog.groupdocs.com/category/viewer/) | [Free Support](https://forum.groupdocs.com/c/viewer) | [Temporary License](https://purchase.groupdocs.com/temporary-license)
