Hi,
When I am creating Radio buttons on the PDF file using the below code, It is adding Radio buttons but the radio option value is not displaying. It is showing radio buttons as circles and caption is missing. Could anybody please help me in fixing this.
Implementation:
Document doc = new Document(“filename.pdf”));
RadioButtonField radio = new RadioButtonField(doc.Pages[1]);
radio.PartialName = txtString[0];
FloatingBox fb = new FloatingBox();
fb.Left = (float)(shapeX * 0.05f);
fb.Top = (float)(shapeY * 0.83f);
doc.Pages[wholeData.shapes[i].p].Paragraphs.Add(fb);
//fb.Width = 50.0f;
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));
fb.Paragraphs.Add(opt1);
}
//radio.SetPosition(new Point((double)shapeX, (double)yaxis));
doc.Form.Add(radio);
Regards,
Nithin Eate