The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Dears, How can we Split Ms Word Multi Page (having Headers & Footers) Document into Separate Files (10 Page Document into 10 files - 1 Page each).Thanks,
SYSethumanikkam Yogendran Syncfusion Team July 27, 2017 01:15 PM UTC
Hi Nilofer,
Thank you for contacting Syncfusion support.
The Word document is a flow document in which contents will not be preserved page by page; instead the contents will be preserved sequentially section by section. Each section may extend to various pages based on its contents like table, text, images etc..
Hence it is not directly possible to access the Word document contents page by page, the same holds in Essential DocIO. As a workaround, you can split the contents of each page as separate section in the input Word document and using DocIO can split into multiple files by sections instead of pages.
Please refer the below code snippet with attached template, and let us know if this helps you.
// Loads an existing input document. WordDocument mainDocument = newWordDocument("Template.docx"); // Iterates each section from main document. foreach (WSection section in mainDocument.Sections)
{ // Creates new Word document. WordDocument currDocument = newWordDocument(); // Clones section to current document. currDocument.Sections.Add(section.Clone()); // Saves Word document and closes the WordDocument instance. currDocument.Save("Template_" + mainDocument.ChildEntities.IndexOf(section) + ".docx"); currDocument.Close(); } mainDocument.Close();
Please let us know if you have any other questions.