using System.IO;
using SautinSoft.Document;
namespace Example
{
class Program
{
static void Main(string[] args)
{
SplitDocumentByPages();
}
static void SplitDocumentByPages()
{
string filePath = @"..\..\..\example.docx";
DocumentCore dc = DocumentCore.Load(filePath);
string folderPath = Path.GetFullPath(@"Result-files");
DocumentPaginator dp = dc.GetPaginator();
for (int i = 0; i < dp.Pages.Count; i++)
{
DocumentPage page = dp.Pages[i];
Directory.CreateDirectory(folderPath);
page.Save(folderPath + @"\Page - " + i.ToString() + ".pdf", SaveOptions.PdfDefault);
}
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(folderPath) { UseShellExecute = true });
}
}
}
Document .Net allows you to split documents into individual pages or sections. This feature is useful for handling large documents where you need to extract or separate content into smaller parts. It supports various document formats such as DOCX, PDF, RTF, HTML, and more.
The product supports various platforms, including Windows, Linux, macOS, and Docker, and is compatible with .NET 8, 7, 6, 5, Standard 2, Core 2x & 3x, and Framework 4.6.2+.