Split word files

You may need to split huge word files into smaller files. Aspose.Words Cloud API can enhance your applications with the ability to split Microsoft Word Documents without needing any 3rd party application. A generous trial quota is awarded when you sign up for free. This lets you evaluate the API in its full capacity before purchasing the API.

Aspose.Words Cloud API supports several programming languages. Different SDKs are available that you can integrate into your applications to test API features in different programming languages. Here we will be considering a few basic examples using C# language. Let us explore the following use cases:

  • Split Word documents DOC/DOCX to multiple files
  • Split Specific Pages of Large Word (DOC/DOCX) documents
  • Split Specific Pages of Word File to PDF

Before we start these examples, let us learn how a file can be uploaded to Cloud Storage. Following code snippet contains the method which uploads a file:

Split Word Documents (DOC/DOCX) to Multiple Files

Splitting a word document to separate pages is now possible with only one API call. Simply set the parameters and perform the operation. Below code demonstrates this feature where few lines of code can achieve these requirements:

The SplitDocumentRequest supports setting some optional parameters including page range values, password if source word file is encrypted, a bool value to specify if you need output files as single ZIP file, as well as fonts location if some custom fonts are being used in the document.

Split Specific Pages of Word Documents

The example we have discussed above splits the whole document to separate pages because the page range is not specified with to and from parameters. Now, let us move forward with a scenario where you want to select specific pages only. It is suitable for scenarios when you do not want to share or print some confidential information. Following code snippet splits page number 3 to 5 and saves the output as a single ZIP file.

Split Specific Pages of Word File to PDF

Aspose.Words Cloud API supports splitting Microsoft Word files into different formats. Instead of first splitting some pages and then converting to the required format, the API supports direct saving of those pages to several file-formats including images, HTML, PDF, and several others. Following code snippet splits page numbers 2 to 6 and saves the output as PDF documents.

This code snippet is efficient enough to split as well as convert a page to a specific format with a single API call. Such exciting features make this API the best fit for all of your document processing needs. If you have any questions about the API, please reach out to us at Free Support Forums. We would love to assist you!

Related Article

Split PDF File into Multiple Files using C# .NET