----- Original Message ----- 
From: "David Rosas" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, May 04, 2007 1:37 PM
Subject: [iText-questions] iText Large Import


>I have 30,000 rows of tax information sitting in a local SQL database.  I'd
> like to make a single PDF file that has 30,000 pages of a single W2 that I
> fill from this database.  Speed/size of final file are important to me. 
> It
> appears I can do this as follows:
>
> 1. use PDF Reader to read the 'template' pdf file (a single-page W2 with
> acrofields)

Read it only once from file and then use repeatedly the constructor new 
PdfReader(PdfReader).

> 2. use a PDFStamper to get and fill the acrofields from my database
> 3. Flatten the file and call .close on the stamper to write it out to a
> separate PDF

This may be done in memory.

> 4. Open up the new PDF in another reader
> 5. Open up my 'combined' PDF file (initially blank) in yet another reader

No, this will be the PdfSmartCopy instance that will stay open through this 
process

> 6. Use PdfSmartCopy to copy the contents of the new PDF into the combined
> PDF
> 7. Go back to step 1 and do this again
>
> While I believe this will work, it seems horribly inefficient.  Is there a

Not really inefficient, even if you'd be doing a text only mail merge it 
wouldn't be that different.

> way that I can easily read/fill/flatten a template file and then 
> concetanate
> it to the end of a single PDF without writing it out to a PDF between?  Do 
> I

No, PDFs are not text, you can't just append it to another and expect it to 
work.

> need to continually use a PDFReader to read the template file each time
> through my loop?
>

Yes.

> Any help would be appreciated.

You already have the solution.

Paulo 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to