How to set the position of the radio buttons created in pdf file.
I tried the following code:
wholeData.shapes[i].t = “Gender, Male, Female”;
string[] txtString = wholeData.shapes[i].t.Split(’,’);
RadioButtonField radio = new RadioButtonField(doc.Pages[1]);
radio.PartialName = txtString[0];
for(int loopStrArr = 1; loopStrArr < txtString.Length; loopStrArr++)
{
int row = (loopStrArr - 1) * 15;
float positionX = shapeX + row;
double positionY = yaxis + row;
RadioButtonOptionField opt1 = new RadioButtonOptionField();
opt1.OptionName = txtString[loopStrArr].Replace(" ",string.Empty);
opt1.Width = Convert.ToInt32(wholeData.shapes[i].s);
opt1.Height = Convert.ToInt32(wholeData.shapes[i].s);
radio.Add(opt1);
opt1.Caption = new Aspose.Pdf.Text.TextFragment(txtString[loopStrArr]);
opt1.Border = new Aspose.Pdf.InteractiveFeatures.Annotations.Border(opt1);
opt1.Border.Width = 1;
opt1.Border.Style = Aspose.Pdf.InteractiveFeatures.Annotations.BorderStyle.Solid;
opt1.Characteristics.Border = System.Drawing.Color.Yellow;
opt1.DefaultAppearance.TextColor = System.Drawing.Color.Red;
opt1.SetPosition(new Point((double)positionX, (double)positionY));
doc.Pages[wholeData.shapes[i].p].Paragraphs.Add(opt1);
}
radio.SetPosition(new Point((double)shapeX, (double)yaxis));
doc.Form.Add(radio);
But these radio buttons are generating at the starting of the page. Can anybody please help me out in the.
Regards,
Nithin Eate.