title: Removing pages from PDF is not performing as expected
body: <p>I have written following Java code:</p>
  
  <pre><code>PDDocument document=PDDocument.load(file);
  int noOfPages= document.getNumberOfPages();
  System.out.println(noOfPages);
  boolean bq=document.removePage(2);
  System.out.println(bq);
  boolean bq1=document.removePage(3);
  System.out.println(bq1);
  boolean bq2=document.removePage(4);
  System.out.println(bq2);
  </code></pre>
  
  <p>And getting the output as:</p>
  
  <pre><code>5
  true
  true
  false
  </code></pre>
  
  <p>I can't understand why the <strong>page</strong> with the index <strong><code>4</code> is not removed</strong>.</p>
  
  <p>When I am using only</p>
  
  <pre><code>boolean bq2=document.removePage(4);
  </code></pre>
  
  <p>it is working fine, page got deleted from PDF.</p>