Code Example:
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();
Dim editor As PdfDocumentEditor = New PdfDocumentEditor("file1.pdf")
Dim ms() As MemoryStream = Nothing
editor.SplitToPages( ms)
If Not ms Is Nothing Then
Dim index As Integer
For index = 0 To index « ms.Length- 1 Step + 1
' Do whatever you like against the MemoryStream that represent single page pdf file
' Such as save it
Imports (FileStream fs = New FileStream(String.Format("Page_{0}.pdf", index), FileMode.Create))
{
ms(index).WriteTo(fs)
}
Next
End If
editor.Close()