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

New Post: Implement a resize for animated gif.

$
0
0
The problems with MagickImageCollection have been resolved with changeset 26274. When i have published the next release you can resize the animage gif this way:
using (MagickImageCollection collection = new MagickImageCollection("myPath"))
{
  foreach(MagickImage image in collection)
  {
    image.Resize(62, 62);
  }
  
  collection.Write("myPath");
}

New Post: Convert a pdf page to image

$
0
0
Good morning,

I'm new with Magick.net. I'm developing an application and I have a pdf page which I want to convert to image (jpg,jpeg,bmp,tiff,png,etc) and I don't know how. Is it possible to do it with Magick.Net ?

Waiting for your help

Thanks a lot

New Post: Convert a pdf page to image

New Post: Convert a pdf page to image

$
0
0
Thank you for your answer dlemstra.

I have already Ghostscript installed.

I'll try the code in the discussion and hope it'll work.

Thanks

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

New Post: Convert a pdf page to image

$
0
0
Did you call MagickNET.Initialize() at the start of your program as explained here? The new release has been publish so you could use this code:
using (MagickImageCollection collection = new MagickImageCollection())
{
  MagickReadSettings settings = new MagickReadSettings();
  settings.Density = new MagickGeometry(144, 144);

  collection.Read(file, settings);

  int id = 0;
  foreach (MagickImage image in collection)
  {
    image.Write(destFolder + "img" + id + ".png");
    id++;
  }
}

New Post: Convert a pdf page to image

$
0
0
Hi delmstra

I followed the tutorial and some error occurs and until now I have the same mistake.

Could not load file or assembly 'Magick.NET.dll' or one of its dependencies

New Post: Convert a pdf page to image

$
0
0
I don't know if I'm missing something or not.

These are the steps that I followed.
  1. download Magick.Net package "Magick.NET-6.8.5.401-Q16-x86-net40-client"
  2. un-zip the folder
  3. add a reference to Magick.dll to myproject
  4. call the initialize method, I called it in my Program.cs or my Form() (costructor) and always getting the same error.

New Post: Convert a pdf page to image

$
0
0
Did you install 'Visual C++ Redistributable for Visual Studio 2012 x86'?

New Post: Convert a pdf page to image

$
0
0
Now I got it.

I'm working on Visual Studio 2010 Ultimate, x86 . So I think I can't make it work, is that right ?!

New Post: Convert a pdf page to image

New Post: Convert a pdf page to image

$
0
0
Thank you so much dlemstra , you're so kind , thank you so much for your help.

So good, I installed it and now when I build the project there's no error.

I have another question : after converting the pdf page into an image , how can I call the image and use it ?! Do I have to call "collection" or what ?

New Post: Image conversion in web app

$
0
0
Hi All

I'm having trouble getting the following code to run in an ASP.net web application. This is a brand new web application with one aspx file and the code below is in the Page_Load method as a test.
string path = HostingEnvironment.MapPath(@"~\bin\ImageMagick");
MagickNET.Initialize(path);

using (MagickImage image = new MagickImage(@"c:\test\img_01.svg"))
{
image.Write(@"c:\test\img_01_web.jpg");
}
I get an error like this "System.Runtime.InteropServices.SEHException: External component has thrown an exception". The stack trace looks like this
[SEHException (0x80004005): External component has thrown an exception.]
   Magick.Image.{ctor}(Image* ) +0
   ImageMagick.MagickImage..ctor(String fileName) +57
   WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Users\rgo\Documents\Visual Studio 2010\Projects\WebApplication1\WebApplication1\WebForm1.aspx.cs:19
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064
Not sure what the problem is. I guess it's something to do with the location of the dlls but I can't work it out. The dlls have all been copied to the bin folder in a sub folder called "ImageMagick".

The same code in a console application works ok.

Has anyone got any ideas?

Thanks

Russell

New Post: Image conversion in web app

$
0
0
  • What version of Magick.NET are you using? You can get the version from the Version property of MagickNET.
  • Is your application pool using the correct platform x86/x64?
  • Did you specify the width and height in your svg file?

New Post: Image conversion in web app

$
0
0
Hi

Don't worry. I just managed to get it working. Must have had the wrong path somewhere.

Thanks

Russell

New Post: Convert a pdf page to image

$
0
0
What do you mean by calling and using it? When you write the image you have an object that is the image. You can use the variable 'image' to perform other actions.

New Post: Image conversion in web app

$
0
0
When you are using .NET 4.0 you could use Magick.NET.Web.dll. It makes sure that the code below gets called at the start of the application.
string path = HostingEnvironment.MapPath(@"~\bin\ImageMagick");
MagickNET.Initialize(path);

New Post: Convert a pdf page to image

$
0
0
The conversion works fine now and this is the function I used to do the conversion action and at the same time it returns to me the new name of the converted image

private string convertPdf(string file)
     {
         string newPathImage = "";

         MagickImageCollection collection = new MagickImageCollection();

         MagickReadSettings settings = new MagickReadSettings();

         settings.Density = new MagickGeometry(144, 144);

         collection.Read(file, settings);

         int id = 0;

         foreach (MagickImage image in collection)
          {
            image.Write(file+ "img" + id + ".png");

            newPathImage = image.ToString();

             id++;
          }

          return newPathImage;
     }
the problem when I want to open newPathImage in other action , an error occur "can not open the file "imagepdf.pdfimg0.png"

New Post: Convert a pdf page to image

$
0
0
image.ToString() will not return the filename. 'file+ "img" + id + ".png"' is the name of the file.

The problems you are running into are not really issues related to Magick.NET or ImageMagick. I think you should look for more help somewhere else.

New Post: Convert a pdf page to image

$
0
0
I found the solution for the problem and I want to thank you for your help.

Also I want to apologyze if I bothered you.
Viewing all 3693 articles
Browse latest View live


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