title: Converting images to PDF with iTextSharp preserve clipping path
body: <p>We're looking to convert images in bulk to PDF, programmatically. So far it looks like we will be using iTextSharp but we have an issue with JPG images with clipping path. We are using the following code in our tests:</p>
  
  <pre><code>using (FileStream fs = new FileStream(output, FileMode.Create, FileAccess.Write, FileShare.None))
  {
      using (Document doc = new Document())
      {
          using (PdfWriter writer = PdfWriter.GetInstance(doc, fs))
          {
              doc.Open();
              iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(source);
  
              image.SetAbsolutePosition(0, 0);
              doc.SetPageSize(new iTextSharp.text.Rectangle(0, 0, image.Width, image.Height, 0));
              doc.NewPage();
  
              writer.DirectContent.AddImage(image,false); 
  
              doc.Close();
          }
      }
  }
  </code></pre>
  
  <p>Clipping path in JPG images seems to just be discarded. Is there a way to preserve the clipping path? Also when calling AddImage there is an option for InlineImage, anyone knows what this does?</p>