3
我使用Magick.NET转换图像(.PS格式为.PNG),内部Magick.NET使用Ghostscript转换.ps文件。有没有一种方法可以在不安装Ghostscript的DLL的情况下添加引用。 PS:我正在使用ASP.NET MVC4有没有办法在不安装的情况下引用ghostscript的DLL?
我使用Magick.NET转换图像(.PS格式为.PNG),内部Magick.NET使用Ghostscript转换.ps文件。有没有一种方法可以在不安装Ghostscript的DLL的情况下添加引用。 PS:我正在使用ASP.NET MVC4有没有办法在不安装的情况下引用ghostscript的DLL?
应该可以在不安装Ghostscript的情况下使用它。你应该先在你自己的机器上下载并安装Ghostscript。如果你想使用x64版本的Magick.NET,你应该安装x64版本的Ghostscript。您需要安装它,因为您需要将文件gsdll64.dll或gsdll32.dll复制到您的应用程序。我没有测试过这个,所以你可能必须先将dll复制到你的bin目录下才能使用。您可以尝试将其放在bin目录之外。
之前,你在你的应用程序中使用Magick.NET确保你做以下电话:
MagickNET.SetGhostscriptDirectory(@"c:\directory\where\you\put\the\dll\of\ghostscript");
非常感谢你。它工作 – Jaikumar
我需要bin文件夹,无论它安装在哪里 –
'string binDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly()。GetName()。CodeBase);' 'int i = binDir = binDir.Substring(i + 2);' 'MagickNET.SetGhostscriptDirectory(binDir);' –