title: How to split a PDF based on a size limit?
body: <p>I have searched many places but unable to find a pretty good solution as such.
  So what I am trying to achieve is as below:
  My program will have quite a lot of PDF docs which I will have to send via mail. There is a mail server limitation of 4 MB. So if all the PDFs are less than 4 MB it will be sent as a single mail. Else I will have to create multiple files each less than 4 MB. 
  Now my program works fine for the following cases:
  1: Lots of files but each less than 4MB and hence keeping a tab during merging so that none of the merged files get over 4MB.
  2: All files are pretty small and hence merging them together does not go to 4MB limit.</p>
  
  <p>But there can be a scenario where there is one file which is, say, 14MB. I can split that document by pages. But that is also not a good solution as the pagesize is also not evenly distributed across the pages. I have used iText and PDFBox. Any help/pointer will be highly appreciated!</p>