PDF is pretty efficient when it comes to reusing objects. If your pages have many of the same objects that recur from page to page, when you split the pages up, each one of your new pdfs will have the reused objects. Depending on the objects that get reused, this can have a dramatic result on splitting pdfs.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Will Simpson Sent: Tuesday, August 21, 2007 10:09 AM To: [email protected] Subject: [iText-questions] Splitting into single pages size problem Hi, I am using itext 2.0.4 to split PDFs with multiple pages into single pages. I am finding that the size of single page PDF is unexpectedly large. The initial PDF is 50MB, and most of the pages are around 10MB. The PDF has 750 pages, so the resulting size is considerably larger than the original (7500MB!). It is only some PDFs that are affected. I was wondering if anyone has seen similar problems, or has any idea what might be happening. The code I am using is as follows (error handling ommitted). ... PdfReader reader = new PdfReader(pdfInputStream); int endPage = reader.getNumberOfPages(); for (int currentPage = 1; currentPage <= endPage; currentPage++) { Document document = new Document(reader.getPageSizeWithRotation(currentPage)); PdfSmartCopy copy = new PdfSmartCopy(document, getSinglePdfOutputStream(currentPage)); copy.setFullCompression(); document.open(); PdfImportedPage page = copy.getImportedPage(reader, currentPage); copy.addPage(page); document.close(); } ... Regards, Will. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/ ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
