1
public void ConvertPdfPageToImage(string outputFileName, int pageNumber)
    {
      if (pageNumber < 1 || pageNumber > this.PageCount)
        throw new ArgumentException("Page number is out of bounds", "pageNumber");

      using (GhostScriptAPI api = new GhostScriptAPI())
        api.Execute(this.GetConversionArguments(this._pdfFileName, outputFileName, pageNumber, this.PdfPassword, this.Settings));
    }

我正在使用上述方法将pdf的每一页转换为asp.net中的图像。它适用于一些pdf。但是在使用其他一些 pdf 文件时,它只转换了一些页面并显示“无法处理 GhostScript 命令。错误代码:-100”错误消息。*注意: * pdf 的内存大小不是这里的问题。

4

0 回答 0