title: Delete pdf pages in java with iTextpdf
body: <p>I have an existing function to show pdf files that I can't change.</p>
  
  <p>The input of function is an <code>InputStream</code> variable.
  In the past they used to pass a pdf file to it and it shows it.</p>
  
  <p>But right now they asked me to show only first 30 pages of the pdf. So I am using <code>iTextpdf</code> and I do something like this:</p>
  
  <pre><code>PdfReader reader = new PdfReader (inputStream);
  reader.selectPages("1-30");
  </code></pre>
  
  <p>Now I should send the result as <code>InputStream</code> variable to show method.</p>
  
  <p>How I should do it?
  Thanks</p>