title: Trying to convert plain text file to iTextSharp without losing format
body: <p>I am trying to convert text files to PDF with iText Sharp.
  The conversion itself is not a problem however, I am unable to create the PDF file such that it looks exactly the way the text in the text file is aligned. </p>
  
  <p>This is the code I am using:</p>
  
  <pre><code>public void GetPDF(string data)
      {
  
          using (MemoryStream ms = new MemoryStream())
          {
              Rectangle docSize = new Rectangle(612, 798);
              Document myDocument = new Document(PageSize.A4.Rotate());
  
              PdfWriter.GetInstance(myDocument, new FileStream
                                           ("MyNewPDF.pdf", FileMode.Create));
  
              // step 3:  Open the document now using
              myDocument.Open();
  
              // step 4: Now add some contents to the document
              myDocument.Add(new Paragraph(data));
              myDocument.Close();
          }
      }
  </code></pre>
  
  <p>Does anybody have a suggestion as to what to do to simply convert a text file into PDF without losing the format of the text file?
  Any help is appreciated.</p>