title: Adding lines of text using PDFsharp
body: <p>I am using PDFsharp to create PDF files. My problem is when I lay down the  lines of text to the PDF I get a single line only. So naturally, all of the text that fits on a the first line is visible since the other text has overflowed out of bounds. 
  <a href="https://i.stack.imgur.com/gBC63.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gBC63.png" alt="enter image description here"></a></p>
  
  <p>Please see my code below:</p>
  
  <pre><code>private void createPdf2()
          {
              var title = DateTime.Now.ToString("MM-dd-yyyy-hh-m-ss") + "-" + txtPlazaNumber.Text + "-" + txtLaneNumber.Text;
              var now = DateTime.Now;
              var sb = new StringBuilder();
              sb.AppendLine("Date: " + DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss")).AppendLine(Environment.NewLine);
              sb.AppendLine("Plaza Number: " + txtPlazaNumber.Text).AppendLine(Environment.NewLine);
              sb.AppendLine("Lane Number: " + txtLaneNumber.Text).AppendLine(Environment.NewLine);
              sb.AppendLine("RFID IP Address: " + txtRfidIpAddress.Text).AppendLine(Environment.NewLine);
              sb.AppendLine("RFID Port: " + nRfidPort.Text).AppendLine(Environment.NewLine);
              sb.AppendLine("TFI IP Address: " + txtTfiIpAddress.Text).AppendLine(Environment.NewLine);
              sb.AppendLine("QR Port: " + nQrPort.Text).AppendLine(Environment.NewLine);
  
              sb.AppendLine("Passed Tests").AppendLine();
              foreach(var p in passedList)
              {
                  sb.AppendLine("\t").Append(p.Trim()).AppendLine();
              }
              sb.AppendLine("Failed Tests").AppendLine();
              foreach(var f in failedList)
              {
                  sb.AppendLine("\f").Append(f.Trim()).AppendLine();
              }
  
              PdfDocument pdf = new PdfDocument();
              pdf.Info.Title = title;
              PdfPage pdfPage = pdf.AddPage();
              XGraphics graph = XGraphics.FromPdfPage(pdfPage);
              XFont font = new XFont("Verdana", 12, XFontStyle.Regular);
              graph.DrawString(sb.ToString(), font, XBrushes.Black, new XRect(0, 0, pdfPage.Width.Point, pdfPage.Height.Point), XStringFormats.TopLeft);
              string pdfFilename = title + ".pdf";
              pdf.Save(pdfFilename);
  }
  </code></pre>