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 nuget.org and it can be installed via the Package Manager Console by executing the following command:

NuGet\Install-Package GroupDocs.viewer-Cloud

Version NuGet NuGet-GroupDocsCloud


Requirements

  • .NET Framework 2.0 or .NET Standard 2.0
  • NuGet
  • System.Web when targeting .NET Framework 2.0
  • GroupDocs Cloud credentials — Client ID and Client Secret from the Dashboard

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

using GroupDocs.Viewer.Cloud.Sdk.Api;
using GroupDocs.Viewer.Cloud.Sdk.Client;

string MyClientId = "YourClientId";
string MyClientSecret = "YourClientSecret";

var config = new Configuration(MyClientId, MyClientSecret);
config.ApiBaseUrl = "https://api.groupdocs.cloud";

var apiInstance = new ViewApi(config);

See the full example in Constants.cs.

Convert a local document to JPEG

This example renders a local Word document to JPEG without uploading it to cloud storage.

using System.IO;
using GroupDocs.Viewer.Cloud.Sdk.Api;
using GroupDocs.Viewer.Cloud.Sdk.Client;
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new ViewApi(config);

var response = apiInstance.ConvertAndDownload(new ConvertAndDownloadRequest("jpg", File.OpenRead("sample.docx")));
Console.WriteLine("ConvertAndDownload completed: " + response.Length + " bytes received");

See the full example in ConvertAndDownload.cs.

Render Selected Pages

This example renders pages 2 and 3 of a Word document to HTML.

using System.Collections.Generic;
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;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new ViewApi(config);

var viewOptions = new ViewOptions
{
    FileInfo = new FileInfo { FilePath = "SampleFiles/sample.docx" },
    ViewFormat = ViewOptions.ViewFormatEnum.HTML,
    RenderOptions = new RenderOptions
    {
        PagesToRender = new List<int?> { 2, 3 }
    }
};

var response = apiInstance.CreateView(new CreateViewRequest(viewOptions));
Console.WriteLine("RenderSelectedPages completed: " + response.Pages.Count);

See the full example in RenderSelectedPages.cs.

Render a Password-Protected Document

This example renders a password-protected Word document to HTML.

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;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new ViewApi(config);

var viewOptions = new ViewOptions
{
    FileInfo = new FileInfo
    {
        FilePath = "SampleFiles/password_protected.docx",
        Password = "12345"
    },
    ViewFormat = ViewOptions.ViewFormatEnum.HTML
};

var response = apiInstance.CreateView(new CreateViewRequest(viewOptions));
Console.WriteLine("ViewProtectedDocument completed: " + response.Pages.Count);

See the full example in ViewProtectedDocument.cs.

Get Supported File Formats

Retrieve the formats the viewer API accepts.

using System.Linq;
using GroupDocs.Viewer.Cloud.Sdk.Api;
using GroupDocs.Viewer.Cloud.Sdk.Client;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new InfoApi(config);

var response = apiInstance.GetSupportedFileFormats();

foreach (var entry in response.Formats.Take(5))
{
    Console.WriteLine($"{entry.FileFormat}: {entry.Extension}");
}

See the full example in GetSupportedFormats.cs.

Examples on GitHub

The GroupDocs.Viewer Cloud .NET Examples repository includes ready-to-run examples covering:

CategoryExamples
RenderHTML, PDF, and image output; selected pages; watermarks; protected documents
By formatCAD, email, PDF, spreadsheet, text, Visio, Word processing, archives, Outlook, Project
InfoDocument information, attachments, supported formats

How to run the examples

  1. Clone or download the examples repository
  2. Open Examples/GroupDocs.Viewer.Cloud.Examples.CSharp.sln in Visual Studio 2017 or later
  3. Right-click the solution and select Enable NuGet Package Restore
  4. Edit Examples/GroupDocs.Viewer.Cloud.Examples.CSharp/RunExamples.cs and set Constants.MyClientId and Constants.MyClientSecret
  5. Build and run

For more details, visit Getting Started.


Product Docs Swagger Examples Blog Support 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