I want to get images from PDF file pages. I know that a good solution is to use ghostscriptsharp. It has a special method to get a single page or multiple pages.
GeneratePageThumbs(string inputPath, string outputPath, int firstPage, int lastPage, int width, int height)
Here is my complete code:
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);
}
}
}
But when I use this method I have exception.
ExternalException
Ghostscript conversion error