title: C# Save Bitmap as PDF With iTextSharp
body: <p>The following code creates a bitmap from a control on the form, and then shows a save dialog to save as a JPEG. Can anyone help with the code to save the Bitmap bm as a PDF with iTextSharp?</p>
  
  <pre><code> Bitmap bm = null;
   bm = new Bitmap(this.RCofactorTBS.SelectedTab.Width, this.RCofactorTBS.SelectedTab.Height);
   this.RCofactorTBS.SelectedTab.DrawToBitmap(bm, this.RCofactorTBS.SelectedTab.ClientRectangle);
  
   SaveFileDialog dialog = new SaveFileDialog();
   dialog.Filter = "JPEG|*.jpeg";
   dialog.Title = "Save Test As Jpeg";
   dialog.ShowDialog();
  
   if (dialog.FileName != "" &amp;&amp; bm != null)
   {
      bm.Save(dialog.FileName);
   }
  </code></pre>