Пример #1
0
        public PdfFormField AddRadioButton(PdfFormField radiogroup, string value, float llx, float lly, float urx, float ury)
        {
            PdfFormField radio = PdfFormField.CreateEmpty(writer);

            radio.SetWidget(new Rectangle(llx, lly, urx, ury), PdfAnnotation.HIGHLIGHT_TOGGLE);
            string name = ((PdfName)radiogroup.Get(PdfName.V)).ToString().Substring(1);

            if (name.Equals(value))
            {
                radio.AppearanceState = value;
            }
            else
            {
                radio.AppearanceState = "Off";
            }
            DrawRadioAppearences(radio, value, llx, lly, urx, ury);
            radiogroup.AddKid(radio);
            return(radio);
        }
Пример #2
0
 public PdfFormField AddRadioButton(PdfFormField radiogroup, string value, float llx, float lly, float urx, float ury)
 {
     PdfFormField radio = PdfFormField.CreateEmpty(writer);
     radio.SetWidget(new Rectangle(llx, lly, urx, ury), PdfAnnotation.HIGHLIGHT_TOGGLE);
     string name = ((PdfName)radiogroup.Get(PdfName.V)).ToString().Substring(1);
     if (name.Equals(value)) {
     radio.AppearanceState = value;
     }
     else {
     radio.AppearanceState = "Off";
     }
     DrawRadioAppearences(radio, value, llx, lly, urx, ury);
     radiogroup.AddKid(radio);
     return radio;
 }