I am doing some pdf processing with GhostScript, But I have found some strange issue when I have a file name for example 2. BD tools.pdf or 3 Amendment 1_2013.pdf GhostScript sames to have some issues to open these specific files, and I wanted to know if I maybe missed some argument or how to at least if these files are approached how to ignore them ?
public static void PdfToJpg(string ghostScriptPath, string input, string output)
{
try
{
//To convert a figure to an image file: and to render the same image at 500dpi
String ars = "-dNOPAUSE -sDEVICE=jpeg -r500 -o" + output + "%d.jpg " + input;
Process proc = new Process();
proc.StartInfo.FileName = ghostScriptPath;
proc.StartInfo.Arguments = ars;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.Start();
proc.WaitForExit();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}