title: PDF Page re-ordering using itext
body: <p>i am using <strong>itext pdf</strong> library. can any one know how can i move pages in existing pdf?</p>
  
  <p>Actually i want to <strong>move few last pages at beginning of file.</strong> </p>
  
  <p>It is something like below but i don't understand how it work.</p>
  
  <pre><code> reader = new PdfReader(baos.toByteArray());
   n = reader.getNumberOfPages();
   reader.selectPages(String.format("%d, 1-%d", n, n-1));
   PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(filename));
   stamper.close();
  </code></pre>
  
  <p>Can any one explain in detail?</p>