[英]Ghostscript installation issue on .net
為了在我的 MVC C# 應用程序中安裝 Ghostscript,我遵循了大量的 SO 指南,但我無法識別下面的代碼。 它一直說“找不到 GhostscriptRasterizer(您是否缺少 using 指令或程序集引用?)”
public ActionResult PDFToImages(string pdfFilePath)
{
//...
using (var rasterizer = new GhostscriptRasterizer())
{
//...
}
//...
}
我正在使用 Visual Studio,這是我已經嘗試過的:
如果您的目標是直接使用 Ghostscript .NET,則無需從您的項目中引用原始的 Ghostscript DLL(正如我所說,直到您願意這樣做)。
我在 Windows 7 和 windows 10 上測試了 Ghostscript .NET,只需按照以下步驟操作即可:
為 Windows(32 位)安裝 Ghostscript 9.52 。
使用Nuget package manager ,將Ghostscript .NET添加到我的解決方案中。
根據需要包括使用代碼行(主命名空間和Rasterizer應該可以工作,我還使用Processor ):
using Ghostscript.NET;
using Ghostscript.NET.Processor;
using Ghostscript.NET.Rasterizer;
我已經在一個新的控制台應用程序項目中檢查了您提供的using子句(它使用 Rasterizer 類),並且如果我之前執行這些步驟,則不會返回任何錯誤。
請再次嘗試重復上述操作,如果您設法以這種方式使用 Ghostscript,請告訴我。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.