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.


Docs Swagger Examples Blog Support Release Notes Dashboard

Installation

The package is available at nuget.org and it can be installed via package manager console by executing following command:

PM> NuGet\Install-Package GroupDocs.viewer-Cloud

Version NuGet NuGet-GroupDocsCloud


Quick Start Guide

1. Create an Account

Sign up for a free account at GroupDocs Cloud.

2. Create an API Client App

In the GroupDocs Cloud Dashboard, create a new application or use an existing one to obtain your Client ID and Client Secret.

3. Install the SDK

Add the GroupDocs.Viewer Cloud SDK for .NET by running this command in the Package Manager Console in Visual Studio:

Install-Package GroupDocs.Viewer-Cloud

To update the SDK, use:

Update-Package GroupDocs.Viewer-Cloud

4. Make an API Request

Use your Client ID and Client Secret to authenticate and make API requests. Below is an example using the Document Viewer API:

// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet-samples
// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
string MyClientSecret = "";
string MyClientId = "";

var configuration = new Configuration(MyClientId, MyClientSecret);
var apiInstance = new ViewApi(configuration);

var viewOptions = new ViewOptions {
    FileInfo = new FileInfo {
            FilePath = "SampleFiles/with_tracked_changes.docx"
        },
        ViewFormat = ViewOptions.ViewFormatEnum.HTML,
        RenderOptions = new HtmlOptions {
            WordProcessingOptions = new WordProcessingOptions {
                RenderTrackedChanges = true
            }
        }
};

var response = apiInstance.CreateView(new CreateViewRequest(viewOptions));

Rendering a Document as PDF

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

// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet-samples
using System;
using GroupDocs.Viewer.Cloud.Sdk.Api;
using GroupDocs.Viewer.Cloud.Sdk.Client;
using GroupDocs.Viewer.Cloud.Sdk.Model;
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests;

namespace Examples
{
    class Program
    {
        static void Main(string[] args)
        {
            var configuration = new Configuration
            {
                AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
                AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
            };
            
            var viewerApi = new ViewerApi(configuration);
            var fileInfo = new FileInfo
            {
                FilePath = "SampleFiles/sample.docx"
            };
            
            var viewOptions = new ViewOptions
            {
                FileInfo = fileInfo,
                ViewFormat = ViewOptions.ViewFormatEnum.PDF
            };

            var request = new CreateViewRequest(viewOptions);
            var response = viewerApi.CreateView(request);
            Console.WriteLine("Document rendered: " + response.Pages.Count + " pages.");
        }
    }
}

Render Spreadsheet as HTML

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

// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet-samples
using System;
using GroupDocs.Viewer.Cloud.Sdk.Api;
using GroupDocs.Viewer.Cloud.Sdk.Client;
using GroupDocs.Viewer.Cloud.Sdk.Model;
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests;

namespace Examples
{
    class Program
    {
        static void Main(string[] args)
        {
            var configuration = new Configuration
            {
                AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
                AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
            };

            var viewerApi = new ViewerApi(configuration);
            var fileInfo = new FileInfo
            {
                FilePath = "SampleFiles/sample.xlsx"
            };

            var viewOptions = new ViewOptions
            {
                FileInfo = fileInfo,
                ViewFormat = ViewOptions.ViewFormatEnum.HTML
            };

            var request = new CreateViewRequest(viewOptions);
            var response = viewerApi.CreateView(request);
            Console.WriteLine("Spreadsheet rendered to HTML: " + response.Pages.Count + " pages.");
        }
    }
}

Get Supported File Formats

This code sample retrieves all supported file formats for rendering via the GroupDocs.Viewer Cloud API.

// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet-samples
using System;
using GroupDocs.Viewer.Cloud.Sdk.Api;
using GroupDocs.Viewer.Cloud.Sdk.Client;
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests;

namespace Examples
{
    class Program
    {
        static void Main(string[] args)
        {
            var configuration = new Configuration
            {
                AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
                AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
            };

            var viewerApi = new ViewerApi(configuration);
            var request = new GetSupportedFileFormatsRequest();
            var response = viewerApi.GetSupportedFileFormats(request);

            foreach (var format in response.Formats)
            {
                Console.WriteLine(format.FileFormat + ": " + format.Extension);
            }
        }
    }
}

Docs Swagger Examples Blog Support Release Notes Dashboard


Tags

Document Rendering API | .NET 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


Direct Download

 English