GroupDocs.Viewer for Python via .NET Overview

What is GroupDocs.Viewer?

GroupDocs.Viewer for Python via .NET is a native Python library that renders 170+ file formats — DOCX, PDF, XLSX, PPTX, CAD drawings, email messages, compressed archives, eBooks, and raster images — into HTML, PDF, PNG, or JPG output. It runs entirely on-premise, requires no Microsoft Office installation, and ships as a pre-built wheel on Windows, Linux, and macOS.

Typical uses include:

  • In-app document preview — embed HTML rendering into desktop or web applications so users can read any document format without leaving the app.
  • Server-side rendering pipelines — convert user uploads to PDF for archival or to per-page PNG for thumbnail generation.
  • AI / RAG preprocessing — render DOCX, XLSX, EML, and scanned PDFs into page-level PNG images or structured HTML that LLMs can consume. See Agents and LLM Integration.
  • Redaction and watermarking — apply text watermarks during rendering, or produce password-protected PDFs from unprotected sources.
  • Accessibility and search — generate semantic HTML from PDFs, DWGs, and legacy office formats for indexing and screen readers.

Key Capabilities

CapabilityDescription
170+ file formatsDOCX, PDF, XLSX, PPTX, CAD, email, archives, eBooks, HTML, images, and more. See supported formats.
Four output targetsHTML (embedded or external resources), PDF, PNG, and JPG. Every source format renders to every target.
Load options per formatPasswords, fonts, encodings, sheet indexes, email fields.
View options per targetDPI, page size, watermarks, rotation, image size limits, PDF permissions — tuned per output format.
Page selectionRender the entire document, a subset of pages, or a single page at a time.
Embedded or external HTML resourcesfor_embedded_resources(...) produces self-contained pages; for_external_resources(...) emits separate CSS, font, and image files for indexing systems.
WatermarksAdd text watermarks during rendering — color, size, position, opacity.
PDF rendering optionsProtect output PDFs, reorder pages, adjust image quality, and apply optimization.
AttachmentsExtract attachments from emails, archives, and PDFs.
Document inspectionRead file type, page count, and attachment list without rendering.
StreamsLoad input from file-like objects — handy for cloud blobs and HTTP bodies.
Logging and diagnosticsWire ConsoleLogger through ViewerSettings for production traces.
On-premiseNo cloud calls, no Microsoft Office install, no network traffic.

Quick Example

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

def quick_example():
    """Render a DOCX document to HTML — the hello-world example."""
    with Viewer("./sample.docx") as viewer:
        options = HtmlViewOptions.for_embedded_resources("page_{0}.html")
        viewer.view(options)

if __name__ == "__main__":
    quick_example()
from groupdocs.viewer import Viewer
from groupdocs.viewer.options import LoadOptions, PdfViewOptions, Watermark

def render_with_options():
    """Open a password-protected DOCX, render to PDF with a watermark."""
    load_options = LoadOptions()
    load_options.password = "secret"

    with Viewer("./protected.docx", load_options) as viewer:
        options = PdfViewOptions("./protected.pdf")
        options.watermark = Watermark("CONFIDENTIAL")
        viewer.view(options)

if __name__ == "__main__":
    render_with_options()
page_1.html (317 KB)
page_2.html (149 KB)
page_3.html (113 KB)

Download full output

Where to next

  1. Install the packageInstallation walks through PyPI and offline wheel installation for Windows, Linux, and macOS.
  2. Run your first renderingQuick Start Guide renders a DOCX to HTML, PDF, and PNG in five minutes.
  3. Explore the examplesRunning Examples clones the runnable repository and runs every documented scenario locally or in Docker.
  4. Use it in depth — the Developer Guide covers loading, rendering, inspecting, page selection, watermarks, and attachments.
  5. Render per format — the Rendering Basics section has per-format guides for PDF, Word, Excel, presentations, CAD, email, and more.
  6. Plug it into AI pipelinesAgents and LLM Integration explains the MCP server, AGENTS.md, and how to chain GroupDocs.Viewer with GroupDocs.Conversion for exotic inputs.
Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.