Hi,
the task that I'm trying to accomplish is quite easy. Extract pages from a large PDF file. Due to some additional requirements of the task, I'm to able to use the PdfDocument.Split() method but instead I'm tring to get the task done with this code fragment:
Spire.Pdf.PdfDocument pdfDocument = new PdfDocument();
int pageNum;
pdfDocument.LoadFromFile(FileName);
for (pageNum = 0; pageNum < pdfDocument.Pages.Count; pageNum++)
{
string newFileName = "";
PdfDocument newPdfDocument = new PdfDocument();
newPdfDocument.InsertPage(pdfDocument, pageNum);
Thread.Sleep(1000);
newFileName = DirectoryName + "\\" + "Page" + pageNum.ToString("0000") + ".PDF";
newPdfDocument.SaveToFile(newFileName);
}
Using a source PDF file with a few pages only, this works rally fine. The files being generated are somewhere between 200 and 250 kB each and they all can be opened by Adobe Reader.
When trying to run this code fragment with a source PDF file that's as large as 2.000 pages, it will fail. The size of all the page files generated will only be 9 to 10 kB. It seems they only consist of the rad trial warning in the upper left corner without any futher contents. Trying to open such a file with Adobe Reader results in an error.
Is there any way to get this job done with Spire.PDF for source PDF files as large as 2.000 pages?
Kind regards,
aweidner