Split a PDF Documents
PdfDocumentEditor editor = new PdfDocumentEditor("file1.pdf");
MemoryStream[] ms = null;
editor.SplitToPages(out ms);
if (ms != null)
{
for (int index = 0; index « ms.Length; ++index)
{
// Do whatever you like against the MemoryStream that represent single page pdf file
// Such as save it
using (FileStream fs = new FileStream(String.Format("Page_{0}.pdf", index), FileMode.Create))
{
ms[index].WriteTo(fs);
}
}
}
editor.Close();