【发布时间】:2015-01-29 10:59:57
【问题描述】:
我想从 PDF 文件页面获取图像。我知道一个好的解决方案是使用 ghostscriptsharp。它有一种特殊的方法来获取单页或多页。
GeneratePageThumbs(string inputPath, string outputPath, int firstPage, int lastPage, int width, int height)
这是我的完整代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GhostscriptSharp;
namespace GetPages
{
class Program
{
static void Main(string[] args)
{
GhostscriptWrapper.GeneratePageThumbs(@"C:\Users\User\Downloads\English_Medium_Extra_for_WEB-2.pdf",
@"C:\Users\User\Desktop\Test", 1, 3, 130, 130);
}
}
}
但是当我使用这种方法时,我遇到了异常。
外部异常
Ghostscript转换错误
【问题讨论】:
标签: c# pdf ghostscriptsharp