  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | -none- | -none- 2007-08-21 - By Bart Allen
Back 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: itext-questions-bounces@(protected) [mailto:itext-questions-bounces@(protected)] On Behalf Of Will Simpson Sent: Tuesday, August 21, 2007 10:09 AM To: itext-questions@(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 iText-questions@(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 iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|
 |