public static void Run()
 {
     try
     {
         // ExStart:ExtractImages               
         // The path to the documents directory.
         string dataDir = RunExamples.GetDataDir_AsposePdfFacades_SecuritySignatures();
         string input = dataDir + "DigitallySign.pdf";
         Document doc = new Document(input);
         using (PdfFileSignature signature = new PdfFileSignature(doc))
         {
             if (signature.ContainsSignature())
             {
                 foreach (string sigName in signature.GetSignNames())
                 {
                     string outFile = dataDir + "ExtractImages_out.jpg";
                     using (Stream imageStream = signature.ExtractImage(sigName))
                     {
                         if (imageStream != null)
                         {
                             using (System.Drawing.Image image = Bitmap.FromStream(imageStream))
                             {
                                 image.Save(outFile, ImageFormat.Jpeg);
                             }
                         }
                     }
                 }
             }
         }
         // ExEnd:ExtractImages
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }       
 public static void Run()
 {
     try
     {
         // ExStart:ExtractImages
         // The path to the documents directory.
         string   dataDir = RunExamples.GetDataDir_AsposePdfFacades_SecuritySignatures();
         string   input   = dataDir + "DigitallySign.pdf";
         Document doc     = new Document(input);
         using (PdfFileSignature signature = new PdfFileSignature(doc))
         {
             if (signature.ContainsSignature())
             {
                 foreach (string sigName in signature.GetSignNames())
                 {
                     string outFile = dataDir + "ExtractImages_out.jpg";
                     using (Stream imageStream = signature.ExtractImage(sigName))
                     {
                         if (imageStream != null)
                         {
                             using (System.Drawing.Image image = Bitmap.FromStream(imageStream))
                             {
                                 image.Save(outFile, ImageFormat.Jpeg);
                             }
                         }
                     }
                 }
             }
         }
         // ExEnd:ExtractImages
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }