Java Mailing List Archive

http://www.junlu.com/

Google
Google
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
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
-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/

©2008 junlu.com - Jax Systems, LLC, U.S.A.