title: Adding button in pdf using Itextsharp
body: <p>I am trying to add a button in Pdf using iTextSharp, and when the button is clicked I want to call a service with the modified data. I am able to add radiobuttons but not able to add the Button. Code what I a using is:</p>
  
  <pre><code>public static String[] LANGUAGES_gc = { "English", "German", "Spanish" };
      [HttpGet]
      [ODataRoute("GetPdf")]
      public void DownloadPDF()
      {
          HttpContext.Current.Response.ContentType = "application/pdf";
          HttpContext.Current.Response.AddHeader("content-disposition", "inline;filename=Example.pdf");
          HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
  
          Document doc = new Document(iTextSharp.text.PageSize.A4, 10f, 10f, 100f, 0f);
          string pdfFilePath = HttpContext.Current.Server.MapPath(".") + "/PDFFiles";
          PdfWriter wri = PdfWriter.GetInstance(doc, HttpContext.Current.Response.OutputStream);
          doc.Open();
          doc.AddAuthor("Test author");
          doc.AddCreationDate();
          PdfContentByte cb = wri.DirectContent;
          Font _bf = new Font(Font.FontFamily.HELVETICA, 6);
          PdfFormField _radioGroup = PdfFormField.CreateRadioButton(wri, true);
          _radioGroup.FieldName = "language_gc";
          Rectangle _rect;
          RadioCheckField _radioG;
          PdfFormField _radioField1;
          for (int i = 0; i &lt; LANGUAGES_gc.Length; i++)
          {
              _rect = new Rectangle(46, 806 - i * 40, 60, 788 - i * 40);
              _radioG = new RadioCheckField(wri, _rect, null, LANGUAGES_gc[i]);
              _radioG.BackgroundColor = new GrayColor(0.8f);
              _radioG.BorderColor = GrayColor.BLACK;
              _radioG.CheckType = RadioCheckField.TYPE_CIRCLE;
              _radioField1 = _radioG.RadioField;
              _radioGroup.AddKid(_radioField1);              
  
              ColumnText.ShowTextAligned(cb, Element.ALIGN_LEFT, new Phrase(LANGUAGES_gc[i], new Font(Font.FontFamily.HELVETICA, 18)), 70, 790 - i * 40, 0);
          }
          /* Button */
          _rect = new Rectangle(46, 806 * 40, 60, 788 * 40);
          PushbuttonField button = new PushbuttonField(wri, _rect, "button");
          PdfAnnotation widget = button.Field;
          button.BackgroundColor = new GrayColor(0.75f);
          button.BorderColor = GrayColor.GRAYBLACK;
          button.BorderWidth = 1;
          button.BorderStyle = PdfBorderDictionary.STYLE_BEVELED;
          button.TextColor = GrayColor.GRAYBLACK;
          button.FontSize = 11;
          button.Text = "Button";
          button.Layout = PushbuttonField.LAYOUT_ICON_LEFT_LABEL_RIGHT;
          button.ScaleIcon = PushbuttonField.SCALE_ICON_ALWAYS;
          button.ProportionalIcon = true;
          button.IconHorizontalAdjustment = 0;
          /*----------------------------------------------------*/
          wri.AddAnnotation(_radioGroup);
          cb = wri.DirectContent;
          doc.Close();
          HttpContext.Current.Response.Write(doc);
          HttpContext.Current.Response.End();
      }
  </code></pre>
  
  <p>Please let me know what I have done wrong.</p>