title: iText Pdf Page Byte Size
body: <p>I have a business requirement that requires me to splits pdfs into multiple documents.
  Lets say I have a 100MB pdf, I need to split that into for simplicity sake, into multiple pdfs no larger than 10MB a piece.</p>
  
  <p>I am using iText.</p>
  
  <p>I am going to get the original pdf, and loop through the pages, but how can I determine the file size of each page without writing it separately to the disk?</p>
  
  <p>Sample code for simplicity</p>
  
  <pre>
  <code>
  int numPages = reader.getNumberOfPages();
  
  PdfImportedPage page;
  for (int currentPage = 0; currentPage &lt numPages; ){
      ++currentPage;
      //Get page from reader
      page = writer.getImportedPage(reader, currentPage);
  
  // I need the size in bytes here of the page
  
  }   
  </code>
  </pre>