我正在尝试使用以下示例(第一个函数)中给出的代码将 pdf 转换为 PNG:https ://ghostscriptnet.codeplex.com/SourceControl/latest#Ghostscript.NET/Ghostscript.NET.Samples/示例/DeviceUsageSample.cs
但是,我在启动时收到此错误:“调用'gsapi_init_with_args'时发生错误:-100”......这并不意味着很多。
这个基本示例怎么不起作用?我在这里下载了最新的 Ghostscript.NET.dll:https ://ghostscriptnet.codeplex.com/并将其添加到项目的引用中。我的操作系统是 Windows 7 x32 位,我以管理员身份运行 VisualStudio。
这是我的代码:
private void button6_Click(object sender, EventArgs e)
{
GhostscriptPngDevice devPNG = new GhostscriptPngDevice(GhostscriptPngDeviceType.Png256);
devPNG.GraphicsAlphaBits = GhostscriptImageDeviceAlphaBits.V_4;
devPNG.TextAlphaBits = GhostscriptImageDeviceAlphaBits.V_4;
devPNG.ResolutionXY = new GhostscriptImageDeviceResolution(96, 96);
devPNG.InputFiles.Add(@"D:\Public\FOS.pdf");
devPNG.OutputPath = @"D:\Public\FOS.png";
devPNG.Process();
}