Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Convert a pdf page to image

$
0
0
I tried the code , and each time I run , I've got an error.

I've created this function :

region PDF to image conversion

     private void pdfConvert(string file, string destFolder)
    {
        using (var list = new MagickImageCollection())
        {
            list.Read(file);
            for (int id = 0; id < list.Count; id++)
            {
                using (MagickImage image = new MagickImage())
                {
                    image.Density = new MagickGeometry(144, 144);
                    image.Read(file + "[" + id + "]");
                    image.Quality = 80;
                    image.Write(destFolder + "img" + id + ".jpg");
                }
            }
        }
    }
    #endregion
After that I called the function as follow :

if (openFileDialog1.ShowDialog(this) != DialogResult.OK) return;
            ProjectName = openFileDialog1.FileName;
            string ProjectType = Path.GetExtension(ProjectName);                    
        if (ProjectName.EndsWith(".pdf"))
            {
                pdfConvert(ProjectName, "C:\\");
            }
and this is the error : File Not found Exception handlel.Could not load file or assembly 'Magick.NET.dll' or one of its dependencies.

I really don't know what to do . Please help and sorry for bothering you

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>