GroupDocs.Viewer for .NET overview

What is GroupDocs.Viewer?

GroupDocs.Viewer for .NET is a .NET document viewer and rendering API for C# that enables developers to view and render 190+ document and image formats without installing Microsoft Office or other third-party applications. It supports popular formats such as DOCX, PDF, XLSX, PPTX, CAD drawings, email messages, archives, eBooks, HTML, and raster images.

GroupDocs.Viewer can render documents to HTML, PDF, PNG, or JPG, making it suitable for document previews, web-based viewers, PDF generation, thumbnails, and server-side document processing. The library runs on-premises on supported Windows, Linux, and macOS environments.

Starting with version 26.8, GroupDocs.Viewer for .NET is distributed as a NuGet metapackage. Install the GroupDocs.Viewer package, and NuGet automatically restores the runtime package that matches your project’s target framework. See Installation for details.

Common use cases:

  • Document viewing and preview - render DOCX, PDF, XLSX, PPTX, CAD, email, and other files as HTML, PDF, or images and display them directly in web or desktop applications.
  • Server-side document rendering - convert documents to PDF or render individual pages as PNG or JPG images for previews, thumbnails, and document-processing workflows.
  • Web document viewers - generate HTML pages from documents and integrate document viewing into ASP.NET Core and other .NET applications.
  • Document conversion and publishing - render documents to PDF, HTML, or images for publishing, archiving, and content distribution.
  • AI and document processing workflows - render supported documents to page-level images or HTML for downstream processing, indexing, and analysis.
  • Document security and presentation - add text watermarks and configure PDF output options while rendering documents.

Key Capabilities

CapabilityDescription
190+ file formatsRender Word, Excel, PowerPoint, PDF, CAD, email, archive, eBook, HTML, image, and many other formats. See supported formats.
Multiple output formatsRender supported documents to HTML, PDF, PNG, or JPG.
HTML renderingGenerate HTML with embedded resources or separate CSS, fonts, and images using ForEmbeddedResources(...) or ForExternalResources(...).
Format-specific loading optionsConfigure passwords, fonts, encodings, spreadsheet settings, email options, and other input-specific parameters. See Loading.
Rendering optionsConfigure page size, DPI, image dimensions, rotation, watermarks, PDF permissions, and other output-specific settings.
Page selectionRender an entire document, selected pages, or individual pages.
Text watermarksAdd text watermarks during document rendering and configure their size, position, opacity, and other properties. See Add Text Watermark.
PDF output optionsConfigure PDF security, page order, image quality, and optimization when rendering to PDF.
AttachmentsExtract and save attachments from supported email, archive, and PDF documents.
Document informationGet information such as file type and page count without rendering the entire document.
Stream-based processingLoad documents from Stream, which is useful when processing files from cloud storage, databases, HTTP requests, or other sources.
Logging and diagnosticsConfigure logging through ViewerSettings and ConsoleLogger to help diagnose document-processing issues. See Logging.
CachingCache rendered results to improve performance when the same documents or pages are viewed repeatedly. See Caching Results.
On-premises deploymentProcess documents locally without sending files to a cloud-based document-rendering service or requiring Microsoft Office.

Quick Example

using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;

// Render a DOCX document to HTML - the hello-world example.
using (Viewer viewer = new Viewer("./sample.docx"))
{
    HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources("page_{0}.html");
    viewer.View(options);
}
using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;

// Open a password-protected DOCX, render to PDF with a watermark.
LoadOptions loadOptions = new LoadOptions();
loadOptions.Password = "secret";

using (Viewer viewer = new Viewer("./protected.docx", loadOptions))
{
    PdfViewOptions options = new PdfViewOptions("./protected.pdf");
    options.Watermark = new Watermark("CONFIDENTIAL");
    viewer.View(options);
}
page_1.html (317 KB)
page_2.html (149 KB)
page_3.html (113 KB)

Download full output

Where to next

  1. Install GroupDocs.Viewer - follow the Installation guide to add the NuGet package or install GroupDocs.Viewer using the available distribution options.
  2. Render your first document - use Quick Start Guide to build and run a sample .NET application.
  3. Run GroupDocs.Viewer in Docker - see How to run GroupDocs.Viewer in Docker for a containerized .NET application.
  4. Learn document rendering - explore the Developer Guide for loading documents, rendering pages, retrieving document information, selecting pages, adding watermarks, and working with attachments.
  5. Render specific file formats - see Rendering Basics for examples covering PDF, Word, Excel, presentations, CAD, email, and other formats.
  6. Build a web-based document viewer - follow Integrate GroupDocs.Viewer in an ASP.NET Core Web App to build a self-hosted document viewer with a web UI, storage, and caching.
Close
Loading

Analyzing your prompt, please hold on...

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