This article provides a guide on how to change font in Word with NET REST API. You will learn to automatically change font size in Word with C# Low Code API and other attributes of the font using a .NET cloud SDK. It will provide information about various properties of a font.
Prerequisite
- Create an account and get API credentials
- Download Aspose.Words Cloud SDK for Dotnet to set the font in a Word file
- Setup C# solution project with the above SDK for changing fonts
Steps to Change Font on Word with C# Low Code API
- Initialize the WordsApi object with a client ID and secret for changing the font
- Load the source Words document with some text for setting the new font
- Create a new font and set parameters for bold, size, and italic
- Create the request object using the UpdateRunFontOnlineRequest class to update the font
- Call the UpdateRunFontOnline() method to change the font in the loaded Word file
- Save the response stream from the API with updated fonts in it
The above steps describe how to change font in Word with C# Low Code API. Load the source Word file, create an object of the Font class and set its parameters, instantiate the UpdateRunFontOnlineRequest class object, and use it while calling the UpdateRunFontOnline() method that modifies the font in the uploaded Word file. Fetch the stream from the API response and save it on the disk after changing the font.
Code to Change Font in Word Document with C# REST API
This code exhibits setting the bold style, italic style, and font size in Word with C# Low Code API. You can set color, style, text effect, underline style, all capital letters, and border to list a few. You can also set the paragraph reference using a 0-based index.
This article has taught us to change the font of Word with NET REST API. If you want to change the properties of a Word file, refer to the article on how to change properties of Word document with NET REST API.