I am sooo sorry the performance is worse with the change for pre-loading the 
PDFs in the test-case :(((((( the problem was that I ran the benchmarks with a 
small mistake in my test case ... 

The HEADER tests how to load flattened PDF part templates ...

The  FOOTER tests how to load PDF part templates containing fields  that need 
to be populated.

The mistake was to leave fixed the HEADER always ... so it would load only the 
flattened PDF template and not the footer (see below) [sigh] In any case is 
good to know that loading flattened PDF parts is cheaper.

I mistakenly ran the last benchmark like this:

private static byte[] file2ByteArray(String filePath) throws Exception {
  InputStream input = null;     
  ByteArrayOutputStream output = null;
  try {
    input = new BufferedInputStream(new FileInputStream(HEADER_PATH));
    output = new ByteArrayOutputStream();
    int data = input.read();
    while (data != -1) {
      output.write(data);
                        
      data = input.read();
    }
                
    return output.toByteArray();
  }     
  finally {
    if (input != null) {
      input.close();
    }
                
    if (output != null) {
      output.close();
    }
  }
}

------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to