Lue Lek Huat wrote:
> Hi, I am new to iText. I want to create a customer account statement in 
> PDF. The background of every page is an image which is a pre-printed 
> form.

OK, the best way to make sure the background is added
to every page is by defining the image as a member variable
of a custom made PageEvent implementation, and add this
image in an onEndPage event.

> Records of the statement will be printed at the absolute position 
> within the pre-printed form and the records could be several pages.

Now you are confusing us. The background of the page isn't
an image (like a watermark), but a scanned form?
Do you mean the form is always the same for every page?

> From 
> the examples, I am sure that this can be done using iText but what is 
> the best design or approach to do this?

You aren't specific enough. If the 'image' is a scanned form,
then you could add it to every page as an image. You'll have
to calculate the coordinates of each field, and add the content
from your database on these absolute coordinates, for instance
using ColumnText (there are other ways to do it too).

If your 'image' isn't really an image, but a one page PDF form
(with form fields), then your work is much easier. You can
fill and flatten the form with PdfReader and PdfStamper;
if you need multiple pages, you do this in a loop (keeping
the separate pages in memory for a very short time) and
concatenate the different pages using PdfReader and PdfSmartCopy.

br,
Bruno

-------------------------------------------------------------------------
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
[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