iText only supports setField() in forms created with Designer.

Paulo

----- Original Message ----- 
From: "Pablo" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, January 02, 2007 3:19 PM
Subject: [iText-questions] filling a list box


> Hello, I have problems with this code:
>
>
>
>            PdfReader reader = new PdfReader("lista2.pdf");
>
>            // filling in the form
>
>            PdfStamper stamp1 = new PdfStamper(reader, new
> FileOutputStream("relleno2.pdf"));
>
>            AcroFields form1 = stamp1.getAcroFields();
>
>            HashMap hm = form1.getFields();
>
>            Iterator i = hm.keySet().iterator();
>
>            while (i.hasNext())
>
>            {
>
>                        System.out.println(i.next()+"");
>
>            }
>
>            form1.setField("nombre", "PABLO");
>
>            boolean a = form1.setListOption("lista", new String[]{"a","b"},
> new String[]{"a","b"});
>
>            System.out.println("BOOLEAN: "+a);
>
>            form1.setField("lista", "a");
>
>            stamp1.close();
>
>
>
> setListOption return false and the input file has a field named "lista"
>
>
>
>
>
> this is the program output:
>
>
>
> form1[0].#subform[0].nombre[0]
>
> form1[0].#subform[0].EmailSubmitButton1[0]
>
> form1[0].#subform[0].lista[0]
>
> BOOLEAN: false
>
>
>
> In the output file the list looks empty.
>
>
>
> What is happening?
>
>
>
>


--------------------------------------------------------------------------------


> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share 
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


--------------------------------------------------------------------------------


> _______________________________________________
> 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/
> 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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