  | 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-23 - By Paulo Soares
Back In my machine it takes 1 minute and that's already way too long. The reason is that the application that created the PDF is really lousy, it can't even get the syntax right in the creation data. You PDF is composed of 2503 images each one 2 pixels high. It looks like it was built from a striped TIFF without any effort to adapt the image to the new media.
Paulo
-- -- Original Message -- -- From: "BorisTheCat" <mbrungs@(protected)> To: <itext-questions@(protected)> Sent: Thursday, August 23, 2007 4:10 PM Subject: [iText-questions] One page PDF takes 7-8 minutes to merge ??
> > We used the examples to create a pdf merge program. We have a one-page > PDF, > 26Mb in size that contains an image. It is taking 7-8 minutes to merge > this > PDF. We have written a tiny java app that demonstrates the problem. We > stripped the test app down so that it is only processing one input file so > that it is now really only "merging" one PDF into a new PDF. So... the > app > is only processing a one-page PDF (albeit big pdf) and it is taking 7-8 > minutes to complete. Any help would be GREATLY appreciated to determine > why it is taking this long and whether there is any way to fix this. > > The input PDF can be found at: http://home.fuse.net/mikebrungs/test.pdf > and the source code is shown below: > > > import java.io.File; > import java.io.FileOutputStream; > import com.lowagie.text.Document; > import com.lowagie.text.pdf.PdfCopy; > import com.lowagie.text.pdf.PdfImportedPage; > import com.lowagie.text.pdf.PdfReader; > import java.util.Date; > > public class PdfTest > { > public static void main(String[] args) > { > try > { > // input file > File pdfFile = new File(args[0]); > > // copied file being created > File outFile = new File(args[0] + ".Copied.pdf"); > > System.out.println("Input file is: " + args[0]); > System.out.println("Output file is: " + args[0] + ".Copied.pdf"); > System.out.println("starting at: " + new Date().toString()); > > PdfReader reader = new PdfReader(pdfFile.getPath()); > > reader.consolidateNamedDestinations(); > int numPages = reader.getNumberOfPages(); > > Document document = new > Document(reader.getPageSizeWithRotation(1)); > PdfCopy writer = new PdfCopy(document, new > FileOutputStream(outFile.getPath())); > > document.open(); > > PdfImportedPage page; > > for (int j = 1; j <= numPages; j++) > { > page = writer.getImportedPage(reader, j); > writer.addPage(page); > } > > reader.close(); > writer.close(); > writer.freeReader(reader); > > System.out.println("finishing at: " + new Date().toString()); > } > catch (Exception t) > { > t.printStackTrace(); > } > } > }
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- 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/
|
|
 |