title: iText TextField on a Landscape page - Input text not rotated
body: <p>I'm generating a PDF using iText and wanted to include an iText Form and TextFields so that users can fill in the PDF Form electronically, rather than printing it out.</p>
  
  <p>I've followed the Examples here: <a href="http://itextpdf.com/examples/iia.php?id=161" rel="nofollow">http://itextpdf.com/examples/iia.php?id=161</a></p>
  
  <p>and here: <a href="http://itextpdf.com/examples/iia.php?id=162" rel="nofollow">http://itextpdf.com/examples/iia.php?id=162</a></p>
  
  <p>So far, I have a TextField on my Landscape PDF, and I can click and enter text.</p>
  
  <p>I have two issues:</p>
  
  <ol>
  <li>TextField alignment. To click on the text field, I have to position my mouse to the right of the cell that I added the TextField too. How can I align the TextField with the cell?</li>
  <li>Entered Text Rotation. Once I've entered text, it's displayed rotated and 90 degrees to the rest of the page. How can I set the rotation of this displayed text?</li>
  </ol>
  
  <p>The rotation of the entered text is the thing that bugs me th most. I've tried setting the rotation on the cell and the TextField but that seems to have no effect.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    int rotation = document.getPageSize().getRotation();
  
      PdfFormField pdfForm = PdfFormField.createEmpty(docWriter);
      coverSheetPdfForm.setFieldName("Form");
      coverSheetPdfForm.setRotate(rotation);
  
      ...
  
      cell = new PdfPCell(borderedTable("Cell Title:", tblHeadingFont, "", borderColor));
      cell.setColspan(1);
      cell.setPadding(5f);
      cell.setBorderWidth(0f);
      cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT);
      cell.setMinimumHeight(100f);
  
      TextField textField = new TextField(docWriter, new Rectangle(50, 50,rotation), "cell_text_field");
      textField.setFontSize(12);
      textField.setRotation(rotation);
      textField.setVisibility(TextField.VISIBLE);
      textField.setBorderColor(borderColor);
      textField.setBorderWidth(BORDER_WIDTH);
  
      cell.setCellEvent(new ChildFieldEvent(pdfForm, textField.getTextField(), 1, rotation));
  
      .....
  
      docWriter.addAnnotation(pdfForm);
  </code></pre>
  
  <p>and the ChildFieldEvent code that I've borrowed from the example page, and added a extra parameter for rotation:</p>
  
  <pre><code>/**
   * Creates a ChildFieldEvent.
   * @param parent the parent field
   * @param kid the child field
   * @param padding a padding
   * @param rotation 
   */
  public ChildFieldEvent(PdfFormField parent, PdfFormField kid, float padding, int rotation) {
      this.parent = parent;
      this.kid = kid;
      this.padding = padding;
      this.rotation = rotation;
  }
  
  /**
   * Add the child field to the parent, and sets the coordinates of the child field.
   * @param cell
   * @param rect
   * @param cb 
   * @see com.lowagie.text.pdf.PdfPCellEvent#cellLayout(com.lowagie.text.pdf.PdfPCell,
   *      com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])
   */
  @Override
  public void cellLayout(PdfPCell cell, Rectangle rect, PdfContentByte[] cb) {
      try {
          parent.addKid(kid);
          kid.setWidget(new Rectangle(rect.getLeft(padding), rect.getBottom(padding),
                  rect.getRight(padding), rect.getTop(padding),rotation),
                  PdfAnnotation.HIGHLIGHT_INVERT);
      } catch (Exception e) {
          throw new ExceptionConverter(e);
      }
  } 
  </code></pre>