// ---------------------------------------------------------------------------
public void CellLayout(PdfPCell cell, Rectangle rectangle,
PdfContentByte[] canvases)
{
PdfWriter writer = canvases[0].PdfWriter;
TextField text = new TextField(
writer, rectangle, string.Format("choice_{0}", cf)
);
text.BackgroundColor = new GrayColor(0.75f);
switch(cf) {
case 1:
text.Choices = LANGUAGES;
text.ChoiceExports = EXPORTVALUES;
text.ChoiceSelection = 2;
writer.AddAnnotation(text.GetListField());
break;
case 2:
text.Choices = LANGUAGES;
text.BorderColor = BaseColor.GREEN;
text.BorderStyle = PdfBorderDictionary.STYLE_DASHED;
text.Options = TextField.MULTISELECT;
List<int> selections = new List<int>();
selections.Add(0);
selections.Add(2);
text.ChoiceSelections = selections;
PdfFormField field = text.GetListField();
writer.AddAnnotation(field);
break;
case 3:
text.BorderColor = BaseColor.RED;
text.BackgroundColor = BaseColor.GRAY;
text.Choices = LANGUAGES;
text.ChoiceExports = EXPORTVALUES;
text.ChoiceSelection = 4;
writer.AddAnnotation(text.GetComboField());
break;
case 4:
text.Choices = LANGUAGES;
text.Options = TextField.EDIT;
writer.AddAnnotation(text.GetComboField());
break;
}
}