How to split a single Word DOCX into Separate Documents by Page in Java

// Import classes://import com.cloudmersive.client.invoker.ApiClient;//import com.cloudmersive.client.invoker.ApiException;//import com.cloudmersive.client.invoker.Configuration;//import com.cloudmersive.client.invoker.auth.*;//import com.cloudmersive.client.SplitDocumentApi;ApiClient defaultClient = Configuration.getDefaultApiClient();// Configure API key authorization: ApikeyApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey");Apikey.setApiKey("YOUR API KEY");// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)//Apikey.setApiKeyPrefix("Token");SplitDocumentApi apiInstance = new SplitDocumentApi();File inputFile = new File("/path/to/file"); // File | Input file to perform the operation on.Boolean returnDocumentContents = true; // Boolean | Set to true to return the contents of each Worksheet directly, set to false to only return URLs to each resulting document.  Default is true.try {SplitDocxDocumentResult result = apiInstance.splitDocumentDocx(inputFile, returnDocumentContents);System.out.println(result);} catch (ApiException e) {System.err.println("Exception when calling SplitDocumentApi#splitDocumentDocx");e.printStackTrace();}




There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Building my own OneWheel

OPEX — a paradigm shift

Extract URLs from an HTML File in PHP

How to invest in NFT projects, refer to seven indicators

ITX for Polygon Dapp Devs

Chatfuel + Airtable via Integromat

Why I started software development

How to Identify NSFW Content in an Image in Ruby

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

How to Extract, Decompress Files and Folders from a Zip Archive Automatically with Java

TIL 0607 Jasva Spring — JPA

Photo Filtering API: How to Emboss an Image with Java

How to Convert DocX Files to JPG/JPEG Image Arrays using Java