title: ABCPDF: Split PDF files into single page PDF files
body: <p>I am using ABCpdf tool and I am trying to split 1TB of PDF files (so efficiency is a concern) into single page PDF files.</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>Doc theSrc = new Doc();
  theSrc.Read("C://development//pdfSplitter//Bxdfbc91ca-fc05-4315-8c40-798a77431ee0xP.pdf");
  
  for (int i = 1; i &lt;= theSrc.PageCount; i++)
  {   
      Doc singlePagePdf = new Doc();
      singlePagePdf.Rect.String = singlePagePdf.MediaBox.String = theSrc.MediaBox.String;
      singlePagePdf.AddPage();
      singlePagePdf.AddImageDoc(theSrc, i, null);
      singlePagePdf.FrameRect();
      singlePagePdf.Save("C://development//pdfSplitter//singlePDF//singlePage"+i+".pdf");
      singlePagePdf.Clear();
  }
  theSrc.Clear();
  </code></pre>
  
  <p>This one is very fast BUT it does not keep the rotated pages and they NEED to be.
  I tried to rotate them manually but this very quickly got a bit messy and they did not come out the precise way as they were in the original document.</p>
  
  <p>I have also tried:</p>
  
  <pre><code>Doc theSrc = new Doc();
  theSrc.Read("C://development//pdfSplitter//Bxdfbc91ca-fc05-4315-8c40-798a77431ee0xP.pdf");
  for (int i = 1; i &lt;= theSrc.PageCount; i++)
  {  
      Doc singlePagePdf = new Doc();
      singlePagePdf.Append(theSrc);
      singlePagePdf.RemapPages(i.ToString());
      singlePagePdf.Save("C://development//pdfSplitter//singlePDF//singlePage"+i+".pdf");
      singlePagePdf.Clear();
  }
  theSrc.Clear();
  </code></pre>
  
  <p>This one is about 6 times slower(on large documents) than the first one BUT it keeps the formatting of the rotated pages and that is important. The problem with this one is that I have to append the whole document and remove all the unwanted pages again. This is done for all pages in the file which is very inefficient.</p>
  
  <p>Can anybody help me on this matter?</p>