[EMAIL PROTECTED] wrote:
Thanks for you patience in answering me :)
I wanted your input regarding designing my requirement. In application,
on which I working, there would be lot of email template and which will
be generated and sent by client for whom we are working (one I sent u in
attachment). I am thinking to ask client to send the email in template
in form of AcroForm. Then I can use iTEXT to populate the fields using
iText.
This would be better approach?
Here in template few fields will be repetitive (in some cases we have to
show 2 or more Principal Investigator) like Principal Investigator (see
attachment) so can I insert(copy) portion of text in AcroForm through
iText?
I don't know if I understand the question well enough to give a good answer.
Let me rephrase it:
If your customer gives you a form like the one you attached to your mail
and instead of placeholders marked with < > he has added form fields,
then you can fill these exact form fields (exact coordinates) with content.
In this case the original PDF acts as a template.
If your customer gives you a form like the one you attached to your mail
and says: this is an example (NOT a template) and you have to have one
line with the date, one OR MORE blocks with principal investigator
and the TEXT OF EXEMPTION CATEGORY SELECTED BY CHAIR
can be a variable number of lines, then any PDF they send you is
worthless. It can't be used to compose a new PDF file.
As I already explained I have plenty of projects where I solved this
problem using XML. For instance: the student administration of Ghent
University gives me a PDF with the background of the letter, containing
a header and a footer. They also give me a template in XML. In this
XML there are different clauses.
I read the background letter in an onOpenDocument event,
add the background to each page in an onStartPage event
and then I loop over the database.
For every student I parse the XML file. I replace the <student_name />
and <student_address /> tag with the correct address. When I encounter
a processing instruction wiht <?years_of_study academic_year="2005" ?>
I add a list with one or more study programmes and I select the clauses
that apply for each specific student. Sometimes only one clause applies,
sometimes different clauses apply, causing the layout to differ from student
to student.
I think this is the solution you need. Before you ask: the code I am
writing for Ghent University is closed source.
br,
Bruno
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions