We could split a Word document to separate pages by specifying start and end page number. Secondly, by specifying exact page numbers.
Let’s see both cases in .NET and Java:
Split the document to several one-page documents (by exact page numbers)
.NET
string filePath = @"c:\sample.docx";
string filePathOut = @"c:\output\document_{0}.{1}";
SplitOptions splitOptions = new SplitOptions(filePathOut, new int[] { 3, 6, 8 });
using (Merger merger = new Merger(filePath))
{
merger.Split(splitOptions);
}
Java
String filePath = "c:\sample.docx";
String filePathOut = "c:\output\document_{0}.{1}";
PageSplitOptions splitOptions = new PageSplitOptions(filePathOut, new int[] { 3, 6, 8 });
Merger merger = new Merger(filePath);
merger.split(splitOptions);
Have a look at .NET and Java developers guide. In case of any issue, you could post it on free support forum.
Top comments (0)