Class SmartPdfSplitter


  • public class SmartPdfSplitter
    extends java.lang.Object
    Splits a PDF based on a given file size.
    • Field Detail

      • LOGGER

        private final Logger LOGGER
      • numberOfPages

        protected int numberOfPages
      • currentPage

        protected int currentPage
      • overSized

        protected boolean overSized
    • Constructor Detail

      • SmartPdfSplitter

        public SmartPdfSplitter​(PdfReader reader)
                         throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • hasMorePages

        public boolean hasMorePages()
      • isOverSized

        public boolean isOverSized()
      • split

        public boolean split​(java.io.OutputStream os,
                             long sizeInBytes)
                      throws java.io.IOException,
                             DocumentException
        Throws:
        java.io.IOException
        DocumentException
      • xrefLength

        private long xrefLength​(int size)