  | 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 BorisTheCat
Back
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(); } } }
-- View this message in context: http://www.nabble.com/One-page-PDF-takes-7 (See http://kes-7.ora-code.com)-8 -minutes-to-merge----tf4318146.html#a12295586 Sent from the iText - General mailing list archive at Nabble.com.
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- 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/
|
|
 |