无法使用某些PDF文件处理GhostScript命令错误

时间:2016-12-06 13:46:34

标签: c# pdf ghostscriptsharp

我正在使用带有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作为错误代码。和错误图片如下。

enter image description here

0 个答案:

没有答案
相关问题