On 03/23/12 08:40, Zhang.Xun-An wrote:
> Hi Larry,
> 
> In "http://itextpdf.com/examples/iia.php?id=157";, the 'field_1', 
> 'field_2',...are created by another java block. They are not common field 
> names.
> 
> In http://1t3xt.be/?107, the 'key' is variable. It may be any field name 
> which got from
> 
>       "Set<String> fields = form.getFields().keySet();
>         for (String key : fields) {"
> So, you should replace the special field names with the variable (key). The 
> values of the variable should be gotten by "form.getFields().keySet();"

Hi Zhang,

However, I still don't understand why the example:

  part2.chapter06.FillDataSheet

cited earlier and located here:

  http://www.itextpdf.com/examples/iia.php?id=122

would not be closer to what you're needing.  The only thing
that would have to be changed from the FillDataSheet example
is how to get the values for each field.  In the FillDataSheet,
the field names and values are read from a database connection:

  DatabaseConnection connection = new HsqldbConnection("filmfestival");

In your case, I guess you're getting the names (or keys) and values
some other way.

> 
> If you give me your private email address, I can copy the complete code to 
> you.

You should be able to see my email here:

http://article.gmane.org/gmane.comp.java.lib.itext.general/61457

I'd be happy to look at it; however, I doubt if I could be any further
help.

HTH.

-regards,
Larry


> 
> Thanks,
> 
> Xun-An Zhang
> NHQ - Information Management and Technologies | AC - Gestion et technologies 
> de l'information
> Citizenship and Immigration Canada | Citoyenneté et Immigration Canada
> 219 Laurier Avenue West Ottawa ON K1A 1L1 | 219 avenue Laurier Ouest Ottawa 
> ON K1A 1L1
> Office | Bureau CAN B240b
> [email protected]
> Telephone | Téléphone 613-948-2467
> Facsimile | Télécopieur 613-957-6279
> Government of Canada | Gouvernement du Canada
> 
> -----Original Message-----
> From: Larry Evans [mailto:[email protected]] 
> Sent: March-22-12 6:38 PM
> To: [email protected]
> Subject: Re: [iText-questions] How to fill a general writable PDF file
> 
> On 03/22/12 14:49, Zhang.Xun-An wrote:
>> Actually, I updated:
>>      http://itextpdf.com/examples/iia.php?id=157
>> by changing the 
>>      form.setField("text_1", " MMMMMMMM "); 
>>      form.setField("text_2", " MMMMMMMM "); 
>>       ...
>> with 
>>       form.setField(key,"MMMMMMMM");
>>
>> The 'key' are gotten from the example, http://1t3xt.be/?107
>>
>> The pdf file in above example can be any pdf file, not just created in Java.
>>
>> Thanks,
>>
> [snip[
> There is also the earlier chapter 6 example:
> 
>   http://www.itextpdf.com/examples/iia.php?id=122
> 
> which also uses AcroFields.setField to change a field's value.
> 
[snip]


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to