i'm trying to populate a listbox for a document that was created with adobe acrobat 8 life cycle designer. When I run the following, i get the error: object reference not set to an instance of an object. ListBox1 is the name of the listbox I'm wanting to populate. Is the setlistoption not supported for documents created in adobe designer? Are there any other alternatives to populating a listbox?
Thanks,
Robert
PdfReader pdf = new PdfReader(@"c:\testlistbox.pdf");
PdfStamper stp = new PdfStamper(pdf, File.Create(@"c:\listboxaa1.pdf"));
AcroFields af = stp.AcroFields
;
af.SetListOption("ListBox1", new String[] { "a", "b", "c" }, new String[] { "first", "second", "third" });
stp.Close();
pdf.Close();