title: Adding a New Line in iTextSharp
body: <p>I’ve been trying to solve this problem for a while now to no avail. I have some text in iTextSharp I’m trying to put on a newline. I’ve tried using the <code>\n</code> escape character, <code>Environment.NewLine</code>, and <code>document.Add(new Phrase(Environment.NewLine))</code> without any success. So is there a way to do this? Here is the piece of my code I’m trying to do it in (note the lines commented with <code>//Doesn't work</code>):</p>
  
  <pre><code>//Open the reader
  PdfReader reader = new PdfReader(oldFile);
  Rectangle size = reader.GetPageSizeWithRotation(1);
  Document document = new Document(size);
  // open the writer
  FileStream fs = new FileStream(newFile, FileMode.Create, FileAccess.Write);
  PdfWriter writer = PdfWriter.GetInstance(document, fs);
  document.Open();
  
  //Configure the content
  PdfContentByte cb = writer.DirectContent;
  // select the font properties
  BaseFont bf = BaseFont.CreateFont("c:\\windows\\fonts\\calibri.ttf", BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
  cb.SetColorFill(BaseColor.BLACK);
  cb.SetFontAndSize(bf, 10);
  
  //Write the text here
  cb.BeginText();
  text = "F\n";//Doesn’t work
  document.Add(new Phrase(Environment.NewLine));//Doesn’t work
  text += "o\n";
  text += Environment.NewLine;//Doesn’t work
  text += "o\n";
  cb.ShowTextAligned(PdfContentByte.ALIGN_LEFT, text, 85, 311, 0);
  cb.EndText();
  
  //Create the new page
  PdfImportedPage page = writer.GetImportedPage(reader, 1);
  cb.AddTemplate(page, 0, 0);
  
  //Close all streams
  document.Close();
  fs.Close();
  writer.Close();
  reader.Close();
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p><strong>Edit One:</strong></p>
  
  <p>Still not working with <code>document.Add(new Paragraph("\n"));</code>. Did I do it wrong?</p>
  
  <pre><code>cb.BeginText();
  text = "F";
  document.Add(new Paragraph("\n"));
  text += "o";
  document.Add(new Paragraph("\n"));
  text += "o";
  cb.ShowTextAligned(PdfContentByte.ALIGN_LEFT, text, 85, 311, 0);
  cb.EndText();
  </code></pre>