Question

I am extracting images from pdf in c#.
Someone has suggested that use Aspose namespace which is a third party namespace. I have downloaded the aspose and included in my project as a reference.But the problem is i am not able to find the class PdfExtractor which is used to extract images.
I am sharing the link in which some one has suggested to use aspose and also sharing my code. This is a link

and my code in which i just include aspose

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Aspose;
using Aspose.Pdf;
using Aspose.Pdf.Devices;
using Aspose.Pdf.DOM;
using Aspose.Pdf.Generator;
using Aspose.Pdf.InteractiveFeatures;
using Aspose.Pdf.Structure;
using Aspose.Pdf.Text;
namespace Imageget
{
     public partial class Form1 : Form
  {
       public Form1()
       {
        InitializeComponent();
       }

  }
}

And The class which is suggested in the link is PdfExtractor i am also sharing its code below so one can not waste his time to go to link.

PdfExtractor objExtractor = new PdfExtractor();

//bind input pdf file

objExtractor.BindPdf("input.pdf");

//extract image with specific mode

objExtractor.ExtractImage(ExtractImageMode.Default);

//check if images extracted and save them one by one

while (objExtractor.HasNextImage()) {
objExtractor.GetNextImage(DateTime.Now.Ticks.ToString() + ".jpg");

          }
Était-ce utile?

La solution

A first sight at google told me that you might need to add namespace:

Aspose.Pdf.Facades

Check out here and see the tree at the left.

and don;t forget to look at my comment at the top, it always help to find the namespace of class if i am unable to find it.

hope it helps!

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top