Learn how to split a Word document using the .NET REST API in this step‑by‑step guide. We’ll demonstrate how to automatically extract pages from a Word file with C# and the Aspose.Words Cloud SDK, and explore the various parameters that let you customize the split output.
Prerequisite
- Create an account and get API credentials
- Download Aspose.Words Cloud SDK for Dotnet to split a Word file
- Setup C# solution project with the above SDK for extracting pages
Steps to Split a Word Document with C# Low Code API
- Instantiate an object of the WordsApi class to split the Word file
- Load the Word file into the file stream object
- Create the SplitDocumentOnlineRequest object with the input file, output file, and range of pages
- Call the SplitDocumentOnline object by using the above request object
- Fetch the target output page using the Result.Document.TryGetValue() method and save it on the disk
These steps describe how to split Word DOC with C# REST API. Commence the process by loading the source Word file followed by creating the SplitDocumentOnlineRequest object by providing the input document, output format, output file name, starting page, and ending page. Finally, call the SplitDocumentOnline method to split the document and save the desired output page on the disk.
Code for Online Word Document Splitter in C# Low Code API
This example illustrates how to extract pages from a Word document using the C# Low‑Code API. The destination filename becomes the prefix for each output file, while “_page#” is appended as a postfix, generating a uniquely named file for every page extracted from the source document. As shown in the sample code, any of these files can be retrieved—page 2, for instance, is saved directly to disk.
In this tutorial we’ve built a DOCX splitter with NET REST API. If you need to combine Word files, explore our guide on merging documents here: Merge Word documents with NET REST API.