Click here to Skip to main content
15,894,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
the cod eis given below

C#
public string pdfgenera()
      {
          // Extract all images with width and height more than 200px
          SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();

          string pdfFile = @"D:\ApplicationForm_10.pdf";
          string imageDir = Path.GetDirectoryName(pdfFile);

          List<PdfFocus.PdfImage> pdfImages = null;

          f.OpenPdf(pdfFile);

          if (f.PageCount > 0)
          {
              // Specify to extract only images which have width and height
              // more than 200px
              f.ImageExtractionOptions.MinSize = new System.Drawing.Size(200, 200);

              pdfImages = f.ExtractImages();

              // Show all extracted images.
              if (pdfImages != null && pdfImages.Count > 0)
              {

                  for (int i = 0; i < pdfImages.Count; i++)
                  {
                      string imageFile = Path.Combine(imageDir, String.Format("img{0}.png", i + 1));
                      pdfImages[i].Picture.Save(imageFile);
                      System.Diagnostics.Process.Start(imageFile);
                  }
              }
          }
          return "";
      }



in the abouve code pdfimages count is '0' why
pls help me..
Thanks in advance
Posted
Comments
Sergey Alexandrovich Kryukov 17-Dec-15 0:36am    
We don't have you PDF. What if it has no images? :-)
—SA
Athul MS 17-Dec-15 0:38am    
in 'D' folder i have an pdf file.the file name is ApplicationForm_10.pdf
Sergey Alexandrovich Kryukov 17-Dec-15 1:19am    
In folder?! And?...
—SA
Athul MS 17-Dec-15 1:06am    
hello Sergey pls reply me
[no name] 22-Dec-15 21:14pm    
Your code is seemed to extract images with exact size 200x200, but I am not sure how this code ImageExtractionOptions.MinSize works.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900