This project has moved and is read-only. For the latest updates, please go here.

Unable to open configure file 'magic.xml' to convert pdf to image

Apr 30, 2015 at 9:07 AM
Hello!

I try to convert a pdf to image but I get the following error:
ImageMagick.MagickDelegateErrorException: E.PDF.WinForm.vshost.exe: PDFDelegateFailed `El sistema no puede encontrar el archivo especificado.
' @ error/pdf.c/ReadPDFImage/788 ---> ImageMagick.MagickConfigureWarningException: E.PDF.WinForm.vshost.exe: UnableToOpenConfigureFile `magic.xml' @ warning/configure.c/GetConfigureOptions/708
   --- Fin del seguimiento de la pila de la excepción interna ---
   en ImageMagick.Wrapper.MagickImageCollection.HandleException(MagickException exception)
   en ImageMagick.Wrapper.MagickImageCollection.Read(String fileName, MagickReadSettings readSettings)
   en ImageMagick.MagickImageCollection.Read(String fileName, MagickReadSettings readSettings)
   en E.PDF.Logica.Conversor.convertirAPDF(String sRutaPDF) en C:\_CS\E.PDF\ELIAX.PDF.Logica\Conversor.vb:línea 11
   en E.PDF.WinForm.frmMain.Button1_Click(Object sender, EventArgs e) en C:\_CS\E.PDF\E.PDF.WinForm\frmMain.vb:línea 7
I have installed the following:
  • GhostScript 9.16 for 64 bits
  • Magick.NET-7.0.0.0013-Q16-AnyCPU
  • NET 4.0: Visual C++ Redistributable for Visual Studio 2012 for 64 bits
The program is a windows form developed in Visual Studio 2010. The code is:
Dim settings As New MagickReadSettings()  
        settings.Density = New PointD(300, 300) 
        Using images As New MagickImageCollection() 
            images.Read("c:\tmp\prueba.pdf", settings) 
            Dim horizontal As MagickImage = images.AppendHorizontally() 
            horizontal.Write("c:\tmp\output.jpg") 
        End Using
I checked that xml files are in bin\Debug folder and in bin\Release folder.

What can be the problem?

Thanks in advance
Apr 30, 2015 at 9:20 AM
Your problem is related to the issue that was reported here: https://magick.codeplex.com/discussions/632560. You will have to wait for the next release that will be published this week.
May 5, 2015 at 5:50 PM
Hi again!

I have used the new version (Magick.NET-7.0.0.0014-Q16-AnyCPU) in my program, but I still get the same error.

What can be the problem?

Thanks in advance.
May 5, 2015 at 7:47 PM
Do you have a folder called 'Magick.NET.7.0.0.0014' in your %TEMP% folder (you can just enter this in explorer) and does this folder contain a lot of xml files?
May 6, 2015 at 8:43 AM
Hi!

I have compiled again the application and I have got the folder in %TEMP% folder with a lot of xml files.

It works perfect!

Thanks a lot.