Presentations play a pivotal role in effectively communicating ideas, strategies, and information. Furthermore, to make these presentations more impactful and professional, incorporating the watermarks can make all the difference. Watermarks not only add an extra layer of security to your content but also help in branding and copyright protection. In this article, we are going to explore the power of .NET REST API to easily add image and text watermarks to your Microsoft PowerPoint presentations, enhancing their visual appeal and leaving a lasting impression on your audience.
- REST API for PowerPoint PPT Processing
- Add Text Watermark to PowerPoint Slides using C# .NET
- Insert Image Watermark in PowerPoint Presentation using cURL Commands
REST API for PowerPoint PPT Processing
With the help of Aspose.Slides Cloud SDK for .NET, the process of adding watermarks to your PowerPoint presentations (PPT or PPTX) becomes effortless and highly customizable. This API empowers you to integrate advanced functionalities into your applications, and the watermarking is just a one of the many features it offers. Leverage Aspose.Slides Cloud SDK to easily add image and text watermarks to your presentations with just a few lines of code, saving valuable development time and effort.
Now in order to begin with this feature, the first step is to add the reference of Cloud SDK in our .NET solution. So, search Aspose.Slides-Cloud
in NuGet packages manager and click the Add Package
button. Secondly, visit cloud dashboard and obtain your personalized client credentials.
In case you do not have an existing account, simply create a free account by following the instructions specified in the quick start guide.
Add Text Watermark to PowerPoint Slides using C# .NET
This section explains the details regarding addition of Text watermark to PowerPoint presentation C# .NET.
Given below are the details regarding above stated code snippet.
SlidesApi slidesApi = new SlidesApi(clientID, clientSecret);
Firstly, create an instance of SlidesApi class where we pass client credentials as arguments.
String inputFile = "convertedFile.ppt";
var inputPowerPoint = System.IO.File.OpenRead(inputFile);
Load the content of input PowerPoint presentation in stream instance.
var response = slidesApi.CreateWatermarkOnline(inputPowerPoint,null,fontHeight, watermarkText, fontName, fontColor);
Call the API to add text watermark to all slides of PowerPoint presentation.
saveToDisk(result, "/Users/nayyer/watermarkPowerPoint.pptx");
A custom method to save the resultant watermarked PowerPoint PPTX on local drive.
Insert Image Watermark in PowerPoint Presentation using cURL Commands
While Aspose.Slides Cloud SDK for .NET provides a comprehensive and user-friendly solution for adding watermarks to PowerPoint presentations, you can also achieve the same using cURL commands and the Aspose.Slides Cloud REST API. We know that the cURL commands offer a command-line interface to interact with the API directly, so it becomes an alternative to work through command-line tools.
The first step with this approach is to generate a JWT access token while executing the following command.
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bb959721-5780-4be6-be35-ff5c3a6aa4a2&client_secret=4d84d5f6584160cbd91dba1fe145db14" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
Once the JWT token has been generated, please execute the following command to insert image watermark in PowerPoint presentation:
curl -v "https://api.aspose.cloud/v3.0/slides/{inputPPTX}/watermark/image" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}" \
-H "Content-Type: multipart/form-data" \
-d {"image":@{"aspose.png"}}
Replace inputPPTX
with the name of input PowerPoint PPTX already available in cloud storage, and accessToken
with JWT token generated above.
Conclusion
In conclusion, adding watermarks to PowerPoint presentations is a valuable feature that enhances the visual appeal and branding of your slides. With the powerful Aspose.Slides Cloud SDK for .NET, you can effortlessly incorporate watermarks, whether they are images or text, into your PowerPoint files, giving them a professional touch. The SDK’s extensive capabilities, such as text size, font name and other parameters provide flexibility in customizing watermarks to meet your specific requirements.
Useful Links
Related Articles
We highly recommend visiting the following blogs: