1

How to find the field value for the check box?

<</Rect[263.571 330.311 273.323 338.812]/Subtype/Widget/F 4/P 30 0 R/T(AmountCollect)/DA(/ZaDb 18 Tf 0 g)/FT/Btn/Type/Annot/MK<</CA(8)>>/AP<</D<</COLLECT 148 0 R/Off 149 0 R>>/N<</COLLECT 147 0 R>>>>/AS/Off>>

I tried the following. But I am unable to mark the check box. Please help.

 testForm.SetField("AmountCollect", "Off");
 testForm.SetField("AmountCollect", "Yes");
 testForm.SetField("AmountCollect", "0");
kalyanasundaram v
  • 111
  • 1
  • 4
  • 13

2 Answers2

0

If the string values you're using aren't working, the check box probably uses different names for the appearance state. You can find the possible values of the appearance state using the GetAppearanceStates (see the Buttons example), or you can use iText RUPS to inspect the PDF and search for the names of the appearance states using a GUI.

PS: you can find the C# version of the examples of chapter 8 here.

Bruno Lowagie
  • 75,994
  • 9
  • 109
  • 165
0

testForm.SetField("AmountCollect", "COLLECT"); worked for me.

Reference post : Get the export value of a checkbox using iTextSharp

Community
  • 1
  • 1
kalyanasundaram v
  • 111
  • 1
  • 4
  • 13