title: iTextSharp pdf image from Resource file
body: <p>I create a pdf file using iTextSharp in a windows forms with c#, I want to add an image to the file from the Resource folder(image name: LOGO.png). I have a class ExportToPdf.cs and this class is in the App_Class folder. I am using the code below. Can any one please help.</p>
  
  <pre><code>internal static void exportEchoReport(Patient p)
  {
      using (var ms = new MemoryStream())
      {
          using (var doc1 = new iTextSharp.text.Document(PageSize.A4, 50, 50, 15, 15))
          {
              try
              {
                  PdfWriter writer = PdfWriter.GetInstance(doc1, new FileStream("echo.pdf", FileMode.Create));
                  doc1.Open();
  
                  string imagePath = // I want to use this image LOGO.png (Resources.LOGO)
                  iTextSharp.text.Image logoImg = iTextSharp.text.Image.GetInstance(imagePath);
  
                  PdfPTable headerTable = createTable(logoImg, p);
                  doc1.Add(headerTable);
              }
              catch (Exception ex)
              {
              }
              finally
              {
                  doc1.Close();
              }
          }
          System.Diagnostics.Process.Start("echo.pdf");
      }
  }
  </code></pre>