James Holder wrote:
> All,
> I was hoping for a quick sanity check here. I've got my code working, 
> but I want to make sure I haven't missed an optimizations.

You did right thing asking for alternatives.

You are using PdfCopyFields.
This class is to be used when you have different (!) forms
that need to be concatenated into one single form (!).

The downside of using PdfCopyFields:
- needs a lot of memory: to merge the form, it needs to keep
   track of a lot of data. However: you flatten the form, so
   you don't really need to merge the interactive features.
- results in a big file size, because it is assumed that the
   forms are different. In your case, you're using the same
   form over and over again, so you can drastically reduce the
   filesize!

The relationship between iText's manipulation classes is
explained in chapter 6 of the second edition of "iText in Action".

You should stamp and flatten each form first, using PdfStamper.
See the method addDataSheets() in this example:
http://itextpdf.com/examples/index.php?page=example&id=124

As the forms have a lot in common, you should replace PdfCopy
with PdfSmartCopy to keep the file size low:
http://itextpdf.com/examples/index.php?page=example&id=125

You'll find more info about these classes in the book:
http://itextpdf.com/book/
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
iText-questions mailing list
[email protected]
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