C# API to add watermark for local Microsoft Excel and OpenOffice Calc spreadsheet
C# library to add watermark for local Microsoft Excel and OpenOffice Calc spreadsheet
Add watermark for local Microsoft Excel and OpenOffice Calc spreadsheet - C# REST API
API Request:
POST
https://api.aspose.cloud/v3.0/cells/watermark
Adding watermark for a local spreadsheet is a complex task. Adding watermark for a local spreadsheet transitions is performed by our C# SDK while maintaining the source spreadsheet's main structural and logical content. Our C# library is a professional solution to adding watermark for local spreadsheets online. This Cloud SDK gives C# developers powerful functionality and perfect API.
Code example in C# using REST API to add watermark for local spreadsheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/ | |
namespace Aspose.Cells.Cloud.SDK.Example | |
{ | |
using Aspose.Cells.Cloud.SDK.Api; | |
using Aspose.Cells.Cloud.SDK.Request; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
public partial class CellsApiExample | |
{ | |
public void PostWatermarkExample() | |
{ | |
CellsApi cellsApi = new CellsApi(Environment.GetEnvironmentVariable("CellsCloudTestClientId"), Environment.GetEnvironmentVariable("CellsCloudTestClientSecret")); | |
IDictionary<string, Stream> mapFiles = new Dictionary<string, Stream>(); | |
mapFiles.Add("assemblytest.xlsx", File.OpenRead(@".\TestData\assemblytest.xlsx")); | |
mapFiles.Add("datasource.xlsx", File.OpenRead(@".\TestData\datasource.xlsx")); | |
PostWatermarkRequest request = new PostWatermarkRequest { File = mapFiles, text="Aspose.Cells Cloud" }; | |
cellsApi.PostWatermark(request); | |
} | |
} | |
} | |
// Obsolete | |
//Aspose.Cells.Cloud.SDK.Api.LiteCellsApi liteCellsApi = new Aspose.Cells.Cloud.SDK.Api.LiteCellsApi("your client id", "your client secret"); | |
//IDictionary<string, Stream> mapFiles = new Dictionary<string, Stream>(); | |
//mapFiles.Add("assemblytest.xlsx", File.OpenRead(@".\TestData\assemblytest.xlsx")); | |
//mapFiles.Add("datasource.xlsx", File.OpenRead(@".\TestData\datasource.xlsx")); | |
//Aspose.Cells.Cloud.SDK.Model.FilesResult result = liteCellsApi.PostWatermark(mapFiles,"aspose","#fff"); | |
//Assert.IsNotNull(result); |
How to use C# API to add watermark
- Create an account at Dashboard to get free API quota & authorization details
- Initialize CellsApi with Client Id, Client Secret, Base URL & API version
- Call PostWatermark method to get the resultant stream
System Requirements
- NET Framework 4.5.2 or newer
- Net Standard 2.0 or newer