有没有不用安装即可引用ghostscript DLL的方法吗?

Jai*_*mar 3 .net asp.net-mvc imagemagick ghostscript magick.net

我使用Magick.NET将图像(.PS格式转换为.PNG),在内部Magick.NET使用Ghostscript转换.ps文件。有没有一种无需安装即可添加对Ghostscript DLL的引用的方法。PS:我正在使用ASP.NET MVC4

dle*_*tra 5

无需安装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");
Run Code Online (Sandbox Code Playgroud)

  • `string binDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);` `int i = binDir.IndexOf(':');``binDir = binDir.Substring (i + 2);``MagickNET.SetGhostscriptDirectory(binDir);` (2认同)
  • 谢谢,使用Ghostscript.net dll时会怎么样(它也需要安装gs)我试图将dll复制到bin文件夹,没有结果需要安装 (2认同)