title: Select PDF - Find Emptiness of a PDF Page
body: <p>This is continuation of the previous question. (<a href="https://stackoverflow.com/questions/45973783/removing-empty-pages-in-a-pdf-document-using-c-sharp">Removing Empty Pages in a PDF document using C#</a>) Many thanks for all the help.</p>
  
  <p>Im trying to remove random empty pages from a PDF document which has more than 500 pages. With the help of previous question answers, I thought of iterate through the whole PDF page by page, scan the content and if content is empty remove the empty page. </p>
  
  <p>Now, Im trying to identify the emptiness of the page like shown below. But, below code does not work as pdfPage.ClientRectangle.IsEmpty returns false for empty pages as well. </p>
  
  <pre><code>for (int i = 0; i &lt; completePdf.Pages.Count; i++)
  {
      PdfPage pdfPage = completePdf.Pages[i];
      bool isEmpty = false;
      if (completePdf.Pages[i] != null)
      {
          isEmpty = pdfPage.ClientRectangle.IsEmpty; // this gives false to empty/blank page
      }
      // page removal logic
      if (isEmpty)
      {
          // RemoveAt method usage - http://selectpdf.com/docs/M_SelectPdf_PdfDocument_RemovePageAt.htm
  
      }
  }
  </code></pre>
  
  <p>Any help will be much appreciated and thanks in advance. </p>