Skip to content

Commit

Permalink
Updated sources
Browse files Browse the repository at this point in the history
  • Loading branch information
product-team committed Mar 18, 2021
1 parent 13d6ef5 commit d560e01
Show file tree
Hide file tree
Showing 85 changed files with 196 additions and 217 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2003-2020 Aspose Pty Ltd
Copyright (c) 2003-2019 Aspose Pty Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
126 changes: 57 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,79 @@
![](https://img.shields.io/badge/api-v2.0-lightgrey) ![Nuget](https://img.shields.io/nuget/v/GroupDocs.Viewer-Cloud) ![Nuget](https://img.shields.io/nuget/dt/GroupDocs.Viewer-Cloud) [![GitHub license](https://img.shields.io/github/license/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet)](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet/blob/master/LICENSE)
# GroupDocs.Viewer Cloud SDK for .NET
This repository contains GroupDocs.Viewer Cloud SDK for .NET source code. This SDK allows you to work with GroupDocs.Viewer Cloud REST APIs in your .NET applications.

# .NET SDK to View Documents in the Cloud
## How to use the SDK?
The complete source code is available in this repository folder, you can either directly use it in your project via NuGet package manager. For more details, please visit our [documentation website](https://docs.groupdocs.cloud/display/viewercloud/Available+SDKs#AvailableSDKs-.NET).

[GroupDocs.Viewer Cloud SDK for .NET](https://products.groupdocs.cloud/viewer/net) wraps GroupDocs.Viewer RESTful APIs so you may integrate Document Viewing features in your own apps with zero initial cost.
## Installation

GroupDocs.Viewer Cloud API allows the developers to view & render a number of document formats including Word documents, Excel spreadsheets, PowerPoint presentations, PDF, OpenDocument formats, emails, CAD files & images.
Install GroupDocs.Viewer-Cloud via NuGet

## Document Viewer Services in REST
From the command line:

- 90+ supported file formats.
- View documents as PDF, HTML or images.
- Render documents as raster & vector images.
- Render documents with comments & notes.
- Flip/rotate documents pages at 90, 180 or 270 degrees.
- Reorder document pages.
- Render hidden, consecutive or selected document pages.
- Watermark PDF, image or HTML output pages.
- Render with custom fonts as well as replace any missing fonts.
- Load password-protected documents.
- Extract attachment information such as attachment count & names.
- Extract document information like file format, page count, size and visibility, text coordinates, and so on.
- Integrated storage API.
nuget install GroupDocs.Viewer-Cloud

Check out the [Developer's Guide](https://docs.groupdocs.cloud/viewer/developer-guide/) to know more about GroupDocs.Viewer REST API.
From Package Manager:

## Microsoft File Formats
PM> Install-Package GroupDocs.Viewer-Cloud

**Microsoft Word:** DOC, DOCM, DOCX, DOT, DOTM, DOTX\
**Microsoft Excel:** XLS, XLSX, XLSB, XLSM\
**Microsoft PowerPoint:** PPTX, PPTM, PPT, PPSX, PPSM, PPS, POTX, POTM\
**Microsoft Project:** MPP, MPT\
**Microsoft Outlook:** MSG, OST, PST\
**Microsoft Visio:** VDW, VDX, VSD, VSDM, VSDX, VSS, VSSM, VSSX, VST, VSTM, VSTX, VSX, VTX\
**Microsoft OneNote:** ONE
From within Visual Studio:

## Other Formats

**Page Layout Formats:** PDF, XPS, TEX\
**OpenDocument:** ODT, OTT, ODS, OTS, ODP, OTP\
**CAD:** DNG, DWF, DWG, DXF, IDC, STL\
**Images:** BMP, CGM, DCM, DJVU, EMP, EPS, GIF, ICO, JP2, JPG, ODG, PCL, PNG, PS, PSD, SVG, TIFF, WEBP, WMF\
**Web:** HTML, MHT, MHTML\
**Emails:** EML, EMLX\
**eBooks:** EPUB, MOBI\
**Others:** TXT, RTF, CSV, TSV

## Get Started with GroupDocs.Viewer Cloud SDK for .NET

First create an account at [GroupDocs for Cloud](https://dashboard.groupdocs.cloud/) and get your application information. Next, execute `Install-Package GroupDocs.Viewer-Cloud` from Package Manager Console in Visual Studio to fetch & reference the SDK in your project. If you already have the package and wish to upgrade it, please execute `Update-Package GroupDocs.Viewer-Cloud` to get the latest version.

### Dependencies
1. Open the Solution Explorer.
2. Right-click on a project within your solution.
3. Click on *Manage NuGet Packages...*
4. Click on the *Browse* tab and search for "GroupDocs.Viewer-Cloud".
5. Click on the GroupDocs.Viewer-Cloud package, select the appropriate version in the right-tab and click *Install*.

## Dependencies
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json)

## Add Watermark to DOCX Pages before Rendering
## Getting Started

```csharp
// 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 = "";
using System;
using System.Diagnostics;
using GroupDocs.Viewer.Cloud.Sdk.Api;

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

var viewOptions = new ViewOptions
namespace Example
{
FileInfo = new FileInfo
{
FilePath = "SampleFiles/sample.docx"
},
ViewFormat = ViewOptions.ViewFormatEnum.HTML,

Watermark = new Watermark
public class Example
{
Text = "This is a watermark"
public void Main()
{
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
var appSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
var appKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

var api = new InfoApi(appSid, appKey);

try
{
// Get supported file formats
var response = api.GetSupportedFileFormats();

foreach (var format in response.Formats)
{
Debug.Print(format.ToString());
}
}
catch (Exception e)
{
Debug.Print("Something went wrong: " + e.Message);
}
}
}
};

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

## GroupDocs.Viewer Cloud SDKs in Popular Languages
## Licensing
All GroupDocs.Viewer Cloud SDKs are licensed under [MIT License](LICENSE).

| .NET | Java | PHP | Python | Ruby | Node.js | Android |
|---|---|---|---|---|---|---|
| [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-php) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-python) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-ruby) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-node) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-android) |
| [NuGet](https://www.nuget.org/packages/GroupDocs.Viewer-Cloud/) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-viewer-cloud) | [Composer](https://packagist.org/packages/groupdocscloud/groupdocs-viewer-cloud) | [PIP](https://pypi.org/project/groupdocs-viewer-cloud/) | [GEM](https://rubygems.org/gems/groupdocs_viewer_cloud) | [NPM](https://www.npmjs.com/package/groupdocs-viewer-cloud) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-viewer-cloud-android) |
## Resources
+ [**Website**](https://www.groupdocs.cloud)
+ [**Product Home**](https://products.groupdocs.cloud/viewer)
+ [**Documentation**](https://docs.groupdocs.cloud/display/viewercloud/Home)
+ [**Free Support Forum**](https://forum.groupdocs.cloud/c/viewer)
+ [**Blog**](https://blog.groupdocs.cloud/category/viewer)

[Home](https://www.groupdocs.cloud/) | [Product Page](https://products.groupdocs.cloud/viewer/net) | [Documentation](https://docs.groupdocs.cloud/viewer/) | [Live Demo](https://products.groupdocs.app/viewer/total) | [API Reference](https://apireference.groupdocs.cloud/viewer/) | [Code Samples](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet-samples) | [Blog](https://blog.groupdocs.cloud/category/viewer/) | [Free Support](https://forum.groupdocs.cloud/c/viewer) | [Free Trial](https://dashboard.groupdocs.cloud)
## Contact Us
Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/viewer).
2 changes: 1 addition & 1 deletion src/GroupDocs.Viewer.Cloud.Sdk.Test/Api/AuthApiTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
2 changes: 1 addition & 1 deletion src/GroupDocs.Viewer.Cloud.Sdk.Test/Api/BaseApiTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
2 changes: 1 addition & 1 deletion src/GroupDocs.Viewer.Cloud.Sdk.Test/Api/FileApiTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
2 changes: 1 addition & 1 deletion src/GroupDocs.Viewer.Cloud.Sdk.Test/Api/FolderApiTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd" file="TestFiles.cs">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
2 changes: 1 addition & 1 deletion src/GroupDocs.Viewer.Cloud.Sdk.Test/Api/StorageApiTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -24,6 +24,7 @@
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using GroupDocs.Viewer.Cloud.Sdk.Client;
using GroupDocs.Viewer.Cloud.Sdk.Model;
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests;
Expand Down Expand Up @@ -195,7 +196,7 @@ public void TestCreateViewWithSpreadsheetPaginateSheetsOption()

// Act & Assert
var viewResult = ViewApi.CreateView(request);
Assert.AreEqual(2, viewResult.Pages.Count);
Assert.AreEqual(3, viewResult.Pages.Count);
}

[Test]
Expand Down Expand Up @@ -370,5 +371,29 @@ private void TestCompareOptions(TestFile testFile, RenderOptions options1, Rende

Assert.AreNotEqual(response1.Length, response2.Length);
}

[Test]
public void TestCreateViewWithPdfViewOptions()
{
// Arrange
var testFile = TestFiles.OnePageDocx;
var viewOptions = new ViewOptions
{
FileInfo = testFile.ToFileInfo(),
ViewFormat = ViewOptions.ViewFormatEnum.PDF,
RenderOptions = new PdfOptions
{
PermissionsPassword = "12345",
Permissions = new List<string> { "DenyPrinting" }
}
};

var request = new CreateViewRequest(viewOptions);

// Act & Assert
var viewResult = ViewApi.CreateView(request);

Assert.NotNull(viewResult.File.DownloadUrl);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -191,7 +191,7 @@ public void TestGetInfoWithSpreadsheetPaginateSheetsOption()

// Act & Assert
var infoResult = InfoApi.GetInfo(request);
Assert.AreEqual(2, infoResult.Pages.Count);
Assert.AreEqual(3, infoResult.Pages.Count);
}

[Test]
Expand Down
2 changes: 1 addition & 1 deletion src/GroupDocs.Viewer.Cloud.Sdk.Test/Config.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd" file="Config.cs">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
12 changes: 6 additions & 6 deletions src/GroupDocs.Viewer.Cloud.Sdk/Api/FileApi.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd" file="FileApi.cs">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -254,7 +254,7 @@ public FilesUploadResult UploadFile(UploadFileRequest request)
}
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd" file="CopyFileRequest.cs">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -338,7 +338,7 @@ public CopyFileRequest(string srcPath, string destPath, string srcStorageName =
}
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd" file="DeleteFileRequest.cs">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -408,7 +408,7 @@ public DeleteFileRequest(string path, string storageName = null, string versionI
}
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd" file="DownloadFileRequest.cs">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -478,7 +478,7 @@ public DownloadFileRequest(string path, string storageName = null, string versio
}
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd" file="MoveFileRequest.cs">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -562,7 +562,7 @@ public MoveFileRequest(string srcPath, string destPath, string srcStorageName =
}
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Aspose Pty Ltd" file="UploadFileRequest.cs">
// Copyright (c) 2003-2020 Aspose Pty Ltd
// Copyright (c) 2003-2021 Aspose Pty Ltd
// </copyright>
// <summary>
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Loading

0 comments on commit d560e01

Please sign in to comment.