Skip to content

Commit

Permalink
Replaced source code example
Browse files Browse the repository at this point in the history
  • Loading branch information
babar-raza authored Nov 26, 2020
1 parent 81e18b7 commit 13d6ef5
Showing 1 changed file with 20 additions and 30 deletions.
50 changes: 20 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,42 +53,32 @@ First create an account at [GroupDocs for Cloud](https://dashboard.groupdocs.clo

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

## Get a List of Viewable File Formats
## Add Watermark to DOCX Pages before Rendering

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

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

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

Watermark = new 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);
}
}
Text = "This is a watermark"
}
}
};

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

## GroupDocs.Viewer Cloud SDKs in Popular Languages
Expand Down

0 comments on commit 13d6ef5

Please sign in to comment.