title: iTextSharp: Setting text on textfield that is on a table cell results in text being too wide and squashed
body: <p>I think this might be a bug, but if anyone can help I'd appreciate it. I currently have another question open that deals with a similar issue, but I think this question better exemplifies the problem, and more simply too. That being said I don't want to delete the old one in case it increases my wait time. I yield to the mods to decide which question is better.</p>
  
  <p>Here's a sample application that creates a pdf, then a table. It adds a cell to the table and then ties a fieldpositioningevent to the cell event.</p>
  
  <pre><code>using System;
  using System.Diagnostics;
  using System.IO;
  using iTextSharp.text;
  using iTextSharp.text.pdf;
  
  namespace iTextSharpTextBoxInTableCell
  {
      class Program
      {
          static void Main(string[] args)
          {
              // Create a PDF with a TextBox in a table cell
              BaseFont bfHelvetica = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1250, false);
              Font helvetica12 = new Font(bfHelvetica, 12, Font.NORMAL, BaseColor.BLACK);
  
              Document doc = new Document(PageSize.LETTER, 18f, 18f, 18f, 18f);
              FileStream fs = new FileStream("TextBoxInTableCell.pdf", FileMode.Create);
              PdfWriter writer = PdfWriter.GetInstance(doc, fs);
  
              doc.Open();
              PdfPTable myTable = new PdfPTable(1);
              myTable.TotalWidth = 568f;
              myTable.LockedWidth = true;
              myTable.HorizontalAlignment = 0;
  
              TextField tf = new TextField(writer, new iTextSharp.text.Rectangle(67, 585, 140, 800), "cellTextBox");
              tf.Text = "test";
              PdfPCell tbCell = new PdfPCell(new Phrase(" ", helvetica12));
              iTextSharp.text.pdf.events.FieldPositioningEvents events =
                  new iTextSharp.text.pdf.events.FieldPositioningEvents(writer, tf.GetTextField());
              tbCell.CellEvent = events;
  
              myTable.AddCell(tbCell);
  
              doc.Add(myTable);
  
              doc.Close();
  
              fs.Close();
              Process.Start("TextBoxInTableCell.pdf");
              Console.WriteLine("End Of Program Execution");
              Console.ReadLine();
          }
      }
  }
  </code></pre>
  
  <p>Here's what this field looks like when it's generated: <img src="https://i.stack.imgur.com/qvOqb.png" alt="squashed"></p>
  
  <p>As you can see, the text is squashed. I've published the generated pdf <a href="https://www.dropbox.com/s/lrj0qtbcepefgag/TextBoxInTableCell.pdf" rel="nofollow noreferrer">here</a>.</p>