Browse our Products

If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.


Product Docs Swagger Examples Blog Support Dashboard

Installation

The package is available at PyPI and it can be installed via pip by executing following command:

pip install groupdocs-viewer-cloud

PyPI - Version PyPI - Downloads Python-GroupDocsCloud


Requirements

Dependencies

The SDK automatically installs the following packages:

PackageConstraint
urllib3>= 1.15
six>= 1.10
certifi
python-dateutil

Python Cloud REST API for Document Rendering

GroupDocs.Viewer Cloud SDK for Python offers a powerful document rendering solution that supports 190+ formats such as Word, Excel, PDFs, CAD, emails, and more. Developers can easily convert and render documents into HTML, PDF, and image formats, preserving the original document’s structure and layout. With advanced features like streaming output, custom view options, multi-page rendering, and support for various file types, GroupDocs.Viewer Cloud API provides seamless integration for document viewing needs in any Python web app, script, or automation workflow. Sign up for free to start leveraging the flexibility and capabilities of this robust cloud-based API.

Basic Usage

Simple Viewer Setup - Guide to quickly set up the GroupDocs.Viewer with minimal configuration.
Load Document from Cloud - Instructions on loading documents directly from cloud storage for viewing.
Custom View Options - Steps for customizing the viewer settings such as zoom, layout, and navigation.
Supported File Formats - Detailed list of supported file formats that can be viewed without conversion.

HTML Viewer

Convert Documents to HTML - Process of converting documents to HTML format for seamless browser-based viewing.
Stream HTML Output - Guide on streaming HTML content for document rendering in real-time.
Preserve Document Structure in HTML - Instructions to maintain the original layout and structure when converting to HTML.
Custom HTML Viewing Options - Features for customizing the appearance of HTML-viewed documents, including styles and fonts.

Image Viewer

Convert Documents to Images - Steps to convert documents into image formats like PNG and JPEG for viewing.
Stream Image Output - Guide for streaming image formats from the document viewer.
Customize Image Resolution - Options for setting specific image resolution when viewing documents as images.
Multi-Page Document Image Rendering - Instructions for rendering multi-page documents as separate images.

PDF Viewer

Convert Documents to PDF - Convert any supported document format into a PDF for viewing.
Stream PDF Output - Guide to stream PDF content for optimized viewing in browsers or applications.
Embed PDF Viewer - Instructions for embedding a customizable PDF viewer in your application.
PDF Viewer Support - Features for viewing and interacting with PDF documents.

Render Document

Render Document to HTML, Image, or PDF - Options to render documents into HTML, image, or PDF formats for viewing.
Stream Rendered Output - Stream the rendered document output for real-time access in your application.
Multi-Page Document Rendering - Support for rendering multi-page documents into multiple HTML, image, or PDF files.

Rendering Options by Document Type

Specialized Rendering for File Types - Custom rendering options tailored for various document types like Word, Excel, PDF, and more.
Preserve Document Features - Ensure original document features like layout, text, and formatting are retained during rendering.

Rendering Archive Files

Render ZIP, RAR, and TAR Files - Convert archive file formats like ZIP, RAR, and TAR into viewable content.
Extract and Render Specific Files - Extract specific files from archives and render them without downloading the entire archive.

Rendering CAD Drawings

Render CAD Formats (DWG, DXF, etc.) - Convert and display CAD files such as DWG and DXF for detailed viewing.
Customize CAD Rendering Options - Set specific parameters for CAD rendering, such as zoom level, layer visibility, and layout.

Rendering E-Mail Messages

Render MSG, EML, and MHTML Formats - View email messages in formats like MSG, EML, and MHTML directly within the viewer.
View Attachments - Automatically render and display email attachments for easy access.

Rendering Lotus Notes Database Messages

Render NSF Database Messages - Convert and view Lotus Notes (NSF) database messages in supported formats.
Access Embedded Elements - Render and view embedded images, files, and links within Lotus Notes database messages.

Rendering MS Project Documents

Render MS Project Files (MPP) - Convert MS Project (MPP) files to HTML, images, or PDF for easy viewing.
View Project Data - Render task, resource, and Gantt chart views from MS Project files.

Rendering Outlook Data Files

Render PST and OST Files - Convert Outlook PST and OST data files to HTML, images, or PDF formats for viewing.
View Emails, Calendars, and Contacts - Render individual email messages, calendar events, and contact details from Outlook data files.

Rendering PDF Documents

Convert PDF to HTML, Image, or Other Formats - Render PDF documents into HTML, image, or other supported formats for web-based or application viewing.
PDF Annotations and Bookmarks - Support for rendering PDF documents with annotations, bookmarks, and other embedded elements.

Rendering Spreadsheets

Render Excel Files (XLS, XLSX) - Convert spreadsheet files like XLS and XLSX into HTML, images, or PDF formats.
View Charts and Formulas - Render spreadsheet charts, formulas, and complex cell formats for accurate viewing.

Rendering Text Files

Render Plain Text and CSV Files - Convert plain text and CSV files to HTML, images, or PDF for simplified viewing.
Preserve Text Formatting - Maintain original text layout and formatting during rendering.

Rendering Visio Documents

Render Visio Files (VSD, VSDX) - Convert and display Visio diagram files in HTML, image, or PDF formats.
View Diagrams and Flowcharts - Render diagrams, flowcharts, and shapes from Visio files for clear presentation.

Rendering Word Processing Documents

Render Word Files (DOC, DOCX, ODT) - Convert Word processing files such as DOC, DOCX, and ODT to HTML, image, or PDF formats.
Preserve Document Structure - Ensure accurate rendering of document structure, including headers, footers, and formatting.

Working With Document Pages

Extract Pages from Documents - Extract specific pages from documents for individual rendering.
Customize Page Viewing - Control pagination and page display settings for document viewing.

Rendering Document Pages

Render Pages to HTML, Image, or PDF - Convert individual document pages into HTML, image, or PDF formats for viewing.
Stream Page Output - Stream individual document pages for faster load times and real-time viewing.

Minification of HTML and SVG

Minify HTML Content - Reduce the size of rendered HTML content for faster page loads.
Optimize SVG Output - Minify and optimize SVG output to improve performance without losing quality.

Rendering Document to Responsive HTML

Convert to Responsive HTML - Render documents as responsive HTML that adapts to various screen sizes and devices.
Mobile-Friendly Viewing - Ensure documents are optimized for mobile and tablet devices using responsive HTML rendering.

Working with Attachments

Extract and Render Attachments - Extract and render attachments from documents or email messages for easy viewing.
View Attachment Types - Support for viewing various attachment types like images, documents, and archives.

Licensing and Authentication

Evaluation Mode - Render documents with watermarks during trial.
Secure Authentication - Use Client ID and Client Secret for secure API access.
MIT License - The Python SDK is licensed under the MIT License.

Supported Document Formats

GroupDocs.Viewer Cloud supports 190+ file formats across the following categories:

  • Word Processing: DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF, TXT, ODT, OTT
  • Spreadsheets: XLS, XLSX, XLSB, XLSM, CSV, ODS, OTS, TSV
  • Presentations: PPT, PPTX, PPTM, PPS, PPSX, PPSM, ODP, OTP, POTX, POTM
  • PDF and Page Layout: PDF, XPS, TEX
  • Images: BMP, GIF, JPEG, PNG, TIFF, SVG, PSD, WEBP, ICO, EMF, WMF, and more
  • CAD and Diagrams: DWG, DXF, DWF, DGN, IFC, STL; VSD, VSDX, VSS, VST, and related Visio formats
  • Email and Outlook: MSG, EML, EMLX, MHT, PST, OST
  • Web: HTML, HTM, MHT, MHTML
  • Archives: ZIP, RAR, TAR, and other archive formats
  • Project Management: MPP, MPT
  • eBooks: EPUB, MOBI
  • Notes: ONE (Microsoft OneNote)
  • Lotus Notes: NSF database messages

All supported formats can be rendered as HTML, PNG/JPG, or PDF. For the complete format matrix, see the documentation.

Quick Start

Get your API credentials

To use GroupDocs.Viewer Cloud, sign up at GroupDocs.Cloud Dashboard and get your Client ID and Client Secret.

Initialize the API

Use the following code to start using the GroupDocs.Viewer Cloud SDK for Python:

import groupdocs_viewer_cloud

# Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
client_id = "YourClientId"
client_secret = "YourClientSecret"

# Create API configuration
configuration = groupdocs_viewer_cloud.Configuration(client_id, client_secret)
configuration.api_base_url = "https://api.groupdocs.cloud"

# Create instance of the View API
view_api = groupdocs_viewer_cloud.ViewApi.from_config(configuration)

Render a document to HTML

Once initialized, use this basic example to render a document from cloud storage:

import groupdocs_viewer_cloud

client_id = "YourClientId"
client_secret = "YourClientSecret"

view_api = groupdocs_viewer_cloud.ViewApi.from_keys(client_id, client_secret)

view_options = groupdocs_viewer_cloud.ViewOptions()
view_options.file_info = groupdocs_viewer_cloud.FileInfo()
view_options.file_info.file_path = "SampleFiles/sample.docx"
view_options.view_format = "HTML"

request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
response = view_api.create_view(request)

print("Document rendered: " + str(len(response.pages)) + " pages")

With this quick start guide, you’re all set to begin rendering documents using GroupDocs.Viewer Cloud in your Python applications. For more details, visit the documentation.

Get Supported File Formats

Retrieve the full list of supported file formats available through the Viewer API.

import groupdocs_viewer_cloud

info_api = groupdocs_viewer_cloud.InfoApi.from_keys("YourClientId", "YourClientSecret")

try:
    response = info_api.get_supported_file_formats()

    print("Supported file-formats:")
    for fmt in response.formats:
        print("{0} ({1})".format(fmt.file_format, fmt.extension))
except groupdocs_viewer_cloud.ApiException as e:
    print("Exception when calling get_supported_file_formats: {0}".format(e.message))

Render a Document as PDF

This example demonstrates how to render a Word document to PDF format using GroupDocs.Viewer Cloud API.

import groupdocs_viewer_cloud

view_api = groupdocs_viewer_cloud.ViewApi.from_keys("YourClientId", "YourClientSecret")

view_options = groupdocs_viewer_cloud.ViewOptions()
view_options.file_info = groupdocs_viewer_cloud.FileInfo()
view_options.file_info.file_path = "SampleFiles/sample.docx"
view_options.view_format = "PDF"
view_options.render_options = groupdocs_viewer_cloud.PdfOptions()

request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
response = view_api.create_view(request)

print("Document rendered to PDF: " + response.file.path)

Render Spreadsheet as HTML

This code sample converts an Excel spreadsheet into HTML using GroupDocs.Viewer Cloud API.

import groupdocs_viewer_cloud

view_api = groupdocs_viewer_cloud.ViewApi.from_keys("YourClientId", "YourClientSecret")

view_options = groupdocs_viewer_cloud.ViewOptions()
view_options.file_info = groupdocs_viewer_cloud.FileInfo()
view_options.file_info.file_path = "SampleFiles/sample.xlsx"
view_options.view_format = "HTML"
view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()

request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
response = view_api.create_view(request)

print("Spreadsheet rendered to HTML: " + str(len(response.pages)) + " pages")

Render Document with Responsive HTML Layout

Render a document as responsive HTML that adapts to various screen sizes and devices.

import groupdocs_viewer_cloud

view_api = groupdocs_viewer_cloud.ViewApi.from_keys("YourClientId", "YourClientSecret")

view_options = groupdocs_viewer_cloud.ViewOptions()
view_options.file_info = groupdocs_viewer_cloud.FileInfo()
view_options.file_info.file_path = "SampleFiles/sample.docx"
view_options.view_format = "HTML"
view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
view_options.render_options.is_responsive = True

request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
response = view_api.create_view(request)

print("Responsive HTML rendered: " + str(len(response.pages)) + " pages")

Render Selected Pages

Convert only specific pages of a document, saving processing time when only part of the document is needed.

import groupdocs_viewer_cloud

view_api = groupdocs_viewer_cloud.ViewApi.from_keys("YourClientId", "YourClientSecret")

view_options = groupdocs_viewer_cloud.ViewOptions()
view_options.file_info = groupdocs_viewer_cloud.FileInfo()
view_options.file_info.file_path = "SampleFiles/sample.docx"
view_options.view_format = "HTML"
view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
view_options.render_options.pages_to_render = [2, 3]

request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
response = view_api.create_view(request)

print("Selected pages rendered: " + str(len(response.pages)) + " pages")

Render Word Document with Tracked Changes

Render a Word document including tracked changes in the output HTML.

import groupdocs_viewer_cloud

view_api = groupdocs_viewer_cloud.ViewApi.from_keys("YourClientId", "YourClientSecret")

view_options = groupdocs_viewer_cloud.ViewOptions()
view_options.file_info = groupdocs_viewer_cloud.FileInfo()
view_options.file_info.file_path = "SampleFiles/with_tracked_changes.docx"
view_options.view_format = "HTML"
view_options.render_options = groupdocs_viewer_cloud.HtmlOptions()
view_options.render_options.word_processing_options = groupdocs_viewer_cloud.WordProcessingOptions()
view_options.render_options.word_processing_options.render_tracked_changes = True

request = groupdocs_viewer_cloud.CreateViewRequest(view_options)
response = view_api.create_view(request)

print("Tracked changes rendered: " + str(len(response.pages)) + " pages")

Get Document Information

Retrieve document metadata such as page count before rendering.

import groupdocs_viewer_cloud

info_api = groupdocs_viewer_cloud.InfoApi.from_keys("YourClientId", "YourClientSecret")

view_options = groupdocs_viewer_cloud.ViewOptions()
view_options.file_info = groupdocs_viewer_cloud.FileInfo()
view_options.file_info.file_path = "SampleFiles/sample.docx"

request = groupdocs_viewer_cloud.GetInfoRequest(view_options)
result = info_api.get_info(request)

print("Document pages: " + str(len(result.pages)))

Convert and Download Without Cloud Storage

Render a local document directly and receive the output file without uploading to cloud storage first.

import groupdocs_viewer_cloud

view_api = groupdocs_viewer_cloud.ViewApi.from_keys("YourClientId", "YourClientSecret")

with open("sample.docx", "rb") as file:
    request = groupdocs_viewer_cloud.ConvertAndDownloadRequest("jpg", file)
    output_path = view_api.convert_and_download(request)

print("Convert and download completed: " + output_path)

Sample Projects on GitHub

The GroupDocs.Viewer Cloud Python Samples repository includes ready-to-run examples covering:

CategoryExamples
Basic UsageSupported formats, document info, attachments, convert and download
HTML ViewerResponsive layout, minify HTML, exclude fonts, optimize for printing
Image ViewerAdjust image size, JPG quality, text overlay, text coordinates
PDF ViewerProtect PDF, adjust JPG quality
Common Rendering OptionsWatermarks, selected pages, consecutive pages, comments, notes, custom fonts
Loading OptionsProtected documents, specify encoding
Rendering by File TypeArchive, CAD, email, Outlook, PDF, spreadsheet, Visio, Word, Lotus Notes, MS Project, text

How to run the examples

  1. Clone or download the samples repository
  2. Go to the Examples directory
  3. Edit RunExamples.py and set your client_id and client_secret
  4. Run pip install groupdocs-viewer-cloud -U
  5. Execute python RunExamples.py

For more details, visit Getting Started.


Product Docs Swagger Examples Blog Support Dashboard


Tags

Document Rendering API | Python Cloud API | GroupDocs.Viewer Cloud | REST API | HTML Rendering | PDF Conversion | Image Rendering | Document Viewing | Multi-Page Rendering | Document Streaming | CAD Rendering | E-Mail Message Rendering | Visio Rendering | MS Project Rendering | Outlook Data Rendering | Spreadsheet Rendering | Word Processing Rendering | Custom View Options | Responsive HTML | Attachment Rendering | Secure API Access | Cloud Storage Integration



 English