我正在使用带有C#的GhostScript,它工作正常,但不知道为什么使用某些特定的PDF文件它无效。我查看了GhostScript api,发现此PDF文件的最后一页只出现问题点击此处Download。
GhostScript Runtime版本:v4.0.30319
GhostScript版本:1.2.0.0
Ghostscript API中的错误点如下所示。
public int Execute(string[] args)
{
//Some Coding lines here
// call ghostscript
try
{
//This is the Error line on ghostscript api call
result = NativeMethods.gsapi_init_with_args(_ghostScriptInstance, args.Length, _argumentPointersHandle.AddrOfPinnedObject());
}
finally
{
this.FreeHandles();
}
if (result < (int)ErrorCode.Success) // TODO: often if GhostScript fails because you've passed the wrong combination of params etc, it still returns zero... unhelpful
throw new GhostScriptException(result, args);
return result;
}
始终将-100作为错误代码。和错误图片如下。