title: iTextSharp Pdf pages import memory issue
body: <p>I am using this code to import different pdf files pages to a single document. When i import large files (200 pages or above) I am getting a <code>OutOfMemory</code> exception. Am i doing something wrong here?</p>
  
  <pre><code>    private bool SaveToFile(string fileName)
      {
          try
          {
              iTextSharp.text.Document doc;
              iTextSharp.text.pdf.PdfCopy pdfCpy;
              string output = fileName;
  
              doc = new iTextSharp.text.Document();
              pdfCpy = new iTextSharp.text.pdf.PdfCopy(doc, new System.IO.FileStream(output, System.IO.FileMode.Create));
              doc.Open();
  
              foreach (DataGridViewRow item in dvSourcePreview.Rows)
              {
                  string pdfFileName = item.Cells[COL_FILENAME].Value.ToString();
                  int pdfPageIndex = int.Parse(item.Cells[COL_PAGE_NO].Value.ToString());
                  pdfPageIndex += 1;
  
                  iTextSharp.text.pdf.PdfReader reader = new iTextSharp.text.pdf.PdfReader(pdfFileName);
                  int pageCount = reader.NumberOfPages;
  
                  // set page size for the documents
                  doc.SetPageSize(reader.GetPageSizeWithRotation(1));
  
                  iTextSharp.text.pdf.PdfImportedPage page = pdfCpy.GetImportedPage(reader, pdfPageIndex);
                  pdfCpy.AddPage(page);
  
                  reader.Close();
              }
  
              doc.Close();
  
              return true;
          }
          catch (Exception ex)
          {
              return false;
          }
      }
  </code></pre>