Click here to Skip to main content
13,090,178 members (49,285 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi All

Basically, I have a checkbox list, and on button click, im asking itextsharp to create a list and put it in the field based on whats checked.
here's what a i have:
using li = System.Web.UI.WebControls.ListItem;
using it = iTextSharp.text;
it.List intList = new it.List(it.List.UNORDERED);
foreach (li li in cblInterior.Items)
    if (li.Selected == true)
pdfFormFields.SetField("InteriorText", intList);

but, i get an error at the last line saying: "The best overloaded method match for 'iTextsharp.text.pdf.AcroFields.SetField(string, string)' has some invalid arguments."

But I can't tell what im missing. Doesnt "intList.Add(li.Text)" turn it into a string already? Is it a syntax problem with itextsharp?
Posted 26-Jun-12 15:54pm
Updated 26-Jun-12 18:42pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Here is a sample: Programmatically Complete PDF Form Fields using Visual Basic and the iTextSharp DLL[^]
According to it and the exception you got, you can not pass a list only string key-value pairs. If you want a formatted list you should try to convert intList to a formatted string. But I am not sure if fields support formatted text.
See also:[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 27 Jun 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100