Use JavaScript library to split documents into parts. You can integrate the extracted pages with other data and, as a result, get documents of the form and content that you require. Splitting documents into parts makes it easier to collaborate on them.
This software library provides JavaScript developers with a set of functions to split Word, PDF, EPUB, HTML, DOCX documents into parts. Splitting text into separate files can be used to make it easier to work with sections of documents. The procedure of document splitting can be part of the technology for integrating data into automated information systems or databases.
Our library provides JavaScript developers with all the necessary functions to extract document pages according to the specified mode. This is a stand-alone Node.js via .NET solution that does not need Microsoft Word, Acrobat Reader or other applications installed.
Split document content using different criteria in JavaScript code. You can use the following page extraction modes: 'split by headings', 'split by sections', 'split page by page', 'split by page ranges'.
After splitting the document, you can export the result to the required file format using the 'Document.Save' method. You can also control how document parts are exported to HTML or EPUB formats using the 'DocumentPartSavingCallback' property, which will also allow you to redirect output streams.
Split documents easily with our solution for Node.js via .NET. The following example shows how to split a document using JavaScript:
npm install @aspose/words
Copy
const aw = require('@aspose/words');
var doc = new aw.Document("Input.docx")
for (var page = 0; page < doc.pageCount; page++) {
var extractedPage = doc.extractPages(page, 1);
extractedPage.save(`Output_${page + 1}.docx`);
}
We host our Node.js via .Net packages in NPM repositories. Please follow the step-by-step instructions on how to install "Aspose.Words for Node.js via .NET" to your developer environment.
This package is compatible with Node.js 14.17.0 or higher.